Why do quantum gates need to be unitary?
Often one considers only trace-preserving quantum operations, for which equality in the previous inequality holds. However, quantum gates are unitary, because they are implemented via the action of a Hamiltonian for a specific time, which gives a unitary time evolution according to the Schrödinger equation.
How does Cnot gate work?
Expressed in basis states, the CNOT gate: leaves the control qubit unchanged and performs a Pauli-X gate on the target qubit when the control qubit is in state ∣1⟩; leaves the target qubit unchanged when the control qubit is in state ∣0⟩.
How to apply a gate to one qubit at a time?
If we want to apply a gate to only one qubit at a time (such as in the circuit below), we describe this using tensor product with the identity matrix, e.g.: We can see Qiskit has performed the tensor product: X⊗I = [0 I I 0] = ⎡ ⎢ ⎢ ⎢⎣0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0⎤ ⎥ ⎥ ⎥⎦ X ⊗ I = [ 0 I I 0] = [ 0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0]
How to calculate single qubit unitary in Qiskit?
We can see Qiskit has performed the tensor product: X⊗I = [0 I I 0] = ⎡ ⎢ ⎢ ⎢⎣0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0⎤ ⎥ ⎥ ⎥⎦ X ⊗ I = [ 0 I I 0] = [ 0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0] Calculate the single qubit unitary ( U U) created by the sequence of gates: U = XZH U = X Z H. Use Qiskit’s unitary simulator to check your results.
How to calculate the number of qubits in a circuit?
Instead of calculating this by hand, we can use Qiskit’s aer_simulator to calculate this for us. The unitary simulator multiplies all the gates in our circuit together to compile a single unitary matrix that performs the whole quantum circuit: # In Jupyter Notebooks we can display this nicely using Latex.
What are the different types of single qubit gates?
Single Qubit Gates. 1 1. The Pauli Gates. You should be familiar with the Pauli matrices from the linear algebra section. If any of the maths here is new to you, you should 2 2. Digression: The X, Y & Z-Bases. 3 3. The Hadamard Gate. 4 4. Digression: Measuring in Different Bases. 5 5. The R ϕ -gate.