Say I have

$$\dfrac{1}{\sqrt{2}}\bigl(|1\rangle|221\rangle|0\rangle + |3\rangle|73\rangle|2\rangle\bigr).$$

How can I change that into

$$\dfrac{1}{\sqrt{2}}\bigl(|1\rangle|221\rangle|1\rangle + |3\rangle|73\rangle|2\rangle\bigr)?$$

  • $\begingroup$ What do you mean by a certain term? If it is what it I think you are saying then you are not following linearity. But I just want to clarify. $\endgroup$ – AHusain Mar 14 at 22:28

Assuming that your last spin is of dimension 3, why not just apply the unitary $$ \left(\begin{array}{ccc} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{array}\right)? $$

  • $\begingroup$ How is this achieving what the op has in his example $\endgroup$ – bilanush Mar 15 at 13:26
  • $\begingroup$ It is a unitary which changes 0 to 1, and leaves 2 unchanged. That is all the OP needed to solve his example. $\endgroup$ – DaftWullie Mar 15 at 15:59

The first register the way you write it is about two qubits if not more. In the state, it is either 01 (1) or 11 (3). Then I would just use a X/NOT controlled by the two qubits of the register and only applied when the control is 01. This is done by Toffoli where you use X gate in between the first qubit so the control is applied when it is 0.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.