Ok, I have this circuit, and I'm trying to devise a way to create an 8x8 matrix for any given combination of target qubit and controlled qubit.(adsbygoogle = window.adsbygoogle || []).push({});

(I is the identity matrix, and X is the CNOT operator)

I want it to also include the qubit that passes through untouched because I'm trying to write a program that takes a given state of 3 qubits and runs it through the above circuit.

As of now, for any combination of target and control qubit, I've generated the 8x8 matrices on paper, but I wondering if there's an easier way to generate each case?

If I had to, I suppose I could "brute force" code each individual case (i.e. 1 on 2, 1 on 3, 2 on 3 and their opposites), but it seems like I'm missing something quite easy that wouldn't require that...

Thanks in advance.

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# 3-Qubit Quantum Circuit with 1 CNOT

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads - Qubit Quantum Circuit | Date |
---|---|

A Qubit error rate of QKD BB84 protocol | Jan 16, 2018 |

I Does 'Phase Inversion' grow exponentially? | Dec 13, 2017 |

A Shor's algorithm - need to uncompute auxiliary qubits? | Nov 26, 2017 |

I Is a Qubit in a Quantum Superposition or a Mixed State? | Jan 19, 2017 |

I Two quantum states and qubits... | Jan 10, 2017 |

**Physics Forums - The Fusion of Science and Community**