# X-gate the quantum equivalent of the NOT gate /bit-flip gate

q = QuantumRegister (1)
qc = QuantumCircuit (q)
qc.x(q[0])
qc.draw(output='mpl')

# Z-gate /Phase-shift gate

q = QuantumRegister (1)
qc = QuantumCircuit (q)
qc.z(q[0])
qc.draw(output='mpl')

# H-gate  a measurement will have equal probabilities to become 1 or 0 creating a 'superposition' of states /Hadamard gate

q = QuantumRegister (1)
qc = QuantumCircuit (q)
qc.h(q[0])
qc.draw(output='mpl')

# CX-gate performs the NOT operation (equivalent to applying an X gate) on the second qubit only when the first qubit is |1>, and otherwise leaves it unchanged./CNOT gate

q = QuantumRegister (2)
qc = QuantumCircuit (q)
qc.cx(q[0],q[1])
qc.draw(output='mpl')

# CZ-gate It flips the sign of the target qubit if and only if the control qubit is |1>.

q = QuantumRegister (2)
qc = QuantumCircuit (q)
qc.cz(q[0],q[1])
qc.draw(output='mpl')

# CZ-gate costructed from CX-gate and H-gate
q = QuantumRegister (2)
qc = QuantumCircuit (q)
qc.h(q[1])
qc.cx(q[0],q[1])
qc.h(q[1])
qc.draw(output='mpl')