Search code examples
qiskit

How to change input qubits (q3 and q4) in 5qubit quantum circuit


Working on a quantum using qiskit. I would want to change the input qubit q4, q3 while measuring the output q2, q1 and record the probabilities of possible outcome as far attached figure.

Question: How do I change the input in qiskit? Already created quantum registers and added all qubits (also attached) here.


Solution

  • In Qiskit, each qubit starts off in the ground state (0 state). So, if by change the input you mean change the starting value from 0 to 1, the only way to do that would be to apply an X-Gate to qubits q3 and q4. This gate acts similar to a classical NOT gate, so it can be used to flip a qubit from 0 to 1 or vice-versa.

    Looking at the table in 5(a), they want you to go through all 4 possible inputs for q3 and q4 (00, 01, 10, 11). So for each of these inputs, your X-Gate assignments would be as follows:

    Input 00: No X-Gates needed
    Input 01: X-Gate on q3
    Input 10: X-Gate on q4
    Input 11: X-Gate on q3 and q4