Skip to content

Instantly share code, notes, and snippets.

View TrangOul's full-sized avatar

Marek Madejski TrangOul

View GitHub Profile
@GDLMadushanka
GDLMadushanka / Half-Adder.py
Created February 4, 2020 06:19
Half-Adder implementation using qiskit
from qiskit import *
from qiskit.tools.visualization import plot_bloch_multivector
from qiskit.tools.visualization import plot_histogram
# Creating a circuit with 3 quantum bits and 2 classical bits
qc = QuantumCircuit(3,2)
# Preparing inputs
qc.x(0) # Comment this line to make Qbit0 = |0>
qc.x(1) # Comment this line to make Qbit1 = |0>
@GDLMadushanka
GDLMadushanka / Full-Adder.py
Created February 4, 2020 07:29
Full-Adder implementation using qiskit
from qiskit import *
from qiskit.tools.visualization import plot_bloch_multivector
from qiskit.tools.visualization import plot_histogram
# Creating a circuit with 8 quantum bits and 2 classical bits
qc = QuantumCircuit(8,2)
# Preparing inputs
qc.x(0) # Comment this line to make Qbit0 = |0>
qc.x(1) # Comment this line to make Qbit1 = |0>
@cky26
cky26 / Logical Operators.md
Created October 23, 2021 09:58
Truth table for the 16 logical operators

Logical Operators

# 0x0 0x1 1x0 1x1 Logic Simple Gate Alt Venn Symbols
[L] 0 0 1 1
[R] 0 1 0 1
0 0 0 0 0 [Contradiction] 0 [FALSE] ![Venn0000]
1 0 0 0 1 [Conjunction] L and R [AND] MIN ![Venn0001]