Description
1. a) A C-NOT gate is known as a controlled-NOT gate. Justify this statement
The Controlled-NOT (C-NOT) gate is a two-qubit operation, with one qubit serving as the “control” and the other as the “target”. The action of the C-NOT gate is to flip the state of the target qubit if and only if the control qubit is in the state ∣1⟩. Here is the reasoning:
• Control Aspect: The state of the control qubit determines whether the NOT operation (which is a bit-flip from ∣0⟩ to ∣1⟩ or vice versa) is applied to the target qubit. If the control qubit is in the state ∣0⟩, the target qubit remains unchanged, regardless of its initial state. This conditional behavior is why the gate is termed “controlled”.
• NOT Operation: The NOT gate in classical computing is a unary operation that changes a bit from 0 to 1 or from 1 to 0. In the quantum context, the equivalent operation for a single qubit is the Pauli-X gate, which flips the state of a qubit from ∣0⟩ to ∣1⟩ and vice versa. The C-NOT gate extends this flipping operation to a two-qubit system but does it conditionally based on the control qubit’s state.
1. b) C-NOT gate acts as if statement – justify your statement.
The analogy of a C-NOT gate acting as an “if statement” comes from its conditional operation that mirrors the structure of an “if statement” in classical programming. Here’s how:
• Conditional Execution: In programming, an “if statement” executes a block of code if a specified condition is true. Similarly, the C-NOT gate performs an operation (bit-flip on the target) if a certain condition (the control qubit being in state ∣1⟩) is met.
• Binary Outcome: Just as an “if statement” can result in a binary outcome (the code within runs or does not run), the C-NOT gate has a binary effect on the target qubit—it flips or does not flip based on the control qubit.
• Control Flow: In programming, control flow structures like “if statements” direct the flow of execution. In a quantum circuit, the control qubit of the C-NOT gate similarly directs the flow of quantum information by deciding the outcome for the target qubit.
1. c) What is the out of the circuit C-NOT, shown below, if
i. x= 0, y=0 ii. x=0, y=1
iii. x=1, y=0 iv. x=1, y=1
i. x=0,y=0
• Control qubit |x⟩ = |0⟩, target qubit |y⟩ = |0⟩.
• Since |x⟩ = |0⟩, the target qubit will remain unchanged.
• Output: ∣x⟩=∣0⟩,∣x⊕y⟩=∣0⊕0⟩=∣0⟩
ii. x=0,y=1
• Control qubit |x⟩ = |0⟩, target qubit |y⟩ = |1⟩.
• Since |x⟩ = |0⟩, the target qubit will remain unchanged.
• Output: ∣x⟩=∣0⟩,∣x⊕y⟩=∣0⊕1⟩=∣1⟩
iii. x=1,y=0
• Control qubit |x⟩ = |1⟩, target qubit |y⟩ = |0⟩.
• Since |x⟩ = |1⟩, the target qubit will be flipped.
• Output: ∣x⟩=∣1⟩,∣x⊕y⟩=∣1⊕0⟩=∣1⟩
iv. x=1,y=1
• Control qubit |x⟩ = |1⟩, target qubit |y⟩ = |1⟩.
• Since |x⟩ = |1⟩, the target qubit will be flipped.
• Output: ∣x⟩=∣1⟩,∣x⊕y⟩=∣1⊕1⟩=∣0⟩
2) Write Qiskit code for the above C-NOT circuit.
Attached with files
3) In CNOT gate, if the target qubit is |0> and the control qubit is either |0> or |1> the target takes the value of the control qubit, that is becomes a copy of the control qubit, but the control qubit itself does not change.
Now (for the circuit below), if the control input of the CNOT gate is a superposition (assume q0 = 0), and the target (q1) is |0>, what is the output of the CNOT gate below (actually this is an entanglement circuit; look at the book/class notes)? Note that superposition in control of a C-NOT gate results in Entanglement.
The Hadamard gate creates a superposition on q0 such that its state is 2∣0⟩+∣1⟩. When this superposition is used as the control for a CNOT gate, where the target qubit is ∣0⟩, the resulting two-qubit state becomes entangled.
The output state of the circuit will be an entangled state, where the state of q1 is flipped to ∣1⟩ if q0 is measured to be ∣1⟩, and remains ∣0⟩ if q0 is measured to be ∣0⟩. The resulting entangled state is known as a Bell state, specifically ∣Φ+⟩, which can be represented as:
This code generates a quantum circuit that applies a Hadamard gate to the first qubit followed by a CNOT gate with the first qubit as the control and the second qubit as the target. It then simulates the circuit, prints the resulting state vector, and the measurement counts. The state vector should correspond to the ∣Φ+⟩ Bell state
4) What is the output of the above entanglement circuit, if
i. q 0 = 0, q 1 = 1 ii. q 0 = 1, q 1 = 0 iii. q 0 = 1, q 1 = 1
iv. q0 = 0, q 1 = 0
5) Write QisKit code for the above entanglement circuit.
Attached with assignment
6. Show the output of the following operations of Y Gate and Z gate on basis vectors of |0> and |1> (use
matrix representations of Y, Z, and vectors of |0> and |1> to show the output) Y Gate|0> Output= ?
Y Gate|1> Output= ? Z Gate|0> Output= ?
Z Gate|1> Output= ?




Reviews
There are no reviews yet.