1

I want to make a 2 qubit circuit such that the non-unitary program will transform the regular basis in the way that:

$|0 0\rangle \to |00\rangle$

$|0 1\rangle \to |01\rangle$

$|10\rangle \to |01\rangle$ (the only one that affected)

$|11\rangle \to |11\rangle$

The only way I think of doing it, is after measuring the circuit I will change the classical outcomes so it will fit the transformation, for example in the classic way I would code:

if c[0]==1 & c[1]==0
       c[0]==0
       c[1]==1

but I didn`t find a way to write it in Qiskit language, please help.

Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112

1 Answers1

3

I tried to implement your transformation on IBM Q. Here is the result: Circuit

Input is $|00\rangle$ in this case. You can set input values by application of $X$ gates on q-bits $|q0\rangle$ and $|q1\rangle$.

Please note that this circuit run on a simulator only as reset gate has not been implemented on real IBM Q quantum hardware. But it is possible to simply measure $|q2\rangle$ and $|q3\rangle$. In that case your transformation become reversible.

Martin Vesely
  • 15,244
  • 4
  • 32
  • 75