1

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.

Just hint: first q-bit of result is logical product (AND) of both input q-bits, second one is logical sum (OR) of both inputs. AND and OR can be implemented with Toffoli gate. – Martin Vesely – 2019-11-12T17:13:27.927

2The use of "unreversible" and "ununitary" in your question is unusual. All operations on a quantum circuit must be unitary, and therefore reversible. – Jonathan Trousdale – 2019-11-12T20:55:12.557

1Daniel, I agree with @ChainedSymmetry - the question seems confusing. Do you have a classical circuit, and you are wondering how to realize it with quantum (unitary and reversible) gates? A classical circuit made of $\mathsf{AND}$ and $\mathsf{OR}$ gates, such as any bit of combinatorial logic, may be converted to a unitary, reversible circuit that uses Toffoli gates, as Martin mentions. – Mark S – 2019-11-12T21:36:18.720

1@ChainedSymmetry: It bring to my mind one question: What about reset gate? Naturaly, it is not reversible operation. How does this fit to the concept of quantum computation? – Martin Vesely – 2019-11-12T22:10:18.113

@MartinVesely It's a good question, and DaftWullie gives a good answer here (short answer, you have to take a measurement and possibly bit-flip). I'm guessing this is not easy to implement in hardware, which is why it's only available in IBM Q simulations.

– Jonathan Trousdale – 2019-11-13T03:03:35.297