Quantum logic gates are needed for physical implementation Updated 2024-12-15 +Created 1970-01-01
One direct practical reason is that we need to map the matrix to real quantum hardware somehow, and all quantum hardware designs so far and likely in the future are gate-based: you manipulate a small number of qubits at a time (2) and add more and more of such operations.
While there are "quantum compilers" to increase the portability of quantum programs, it is to be expected that programs manually crafted for a specific hardware will be more efficient just like in classic computers.
TODO: is there any clear reason why computers can't beat humans in approximating any unitary matrix with a gate set?
This is analogous to what classic circuit programmers will do, by using smaller logic gates to create complex circuits, rather than directly creating one huge truth table.
The most commonly considered quantum gates take 1, 2, or 3 qubits as input.
The gates themselves are just unitary matrices that operate on the input qubits and produce the same number of output qubits.
For example, the matrix for the CNOT gate, which takes 2 qubits as input is:
1 0 0 0
0 1 0 0
0 0 0 1
0 0 1 0
The final question is then: if I have a 2 qubit gate but an input with more qubits, say 3 qubits, then what does the 2 qubit gate (4x4 matrix) do for the final big 3 qubit matrix (8x8)? In order words, how do we scale quantum gates up to match the total number of qubits?
The intuitive answer is simple: we "just" extend the small matrix with a larger identity matrix so that the sum of the probabilities third bit is unaffected.
More precisely, we likely have to extend the matrix in a way such that the partial measurement of the original small gate qubits leaves all other qubits unaffected.
For example, if the circuit were made up of a CNOT gate operating on the first and second qubits as in:
0 ----+----- 0
|
1 ---CNOT--- 1
2 ---------- 2
then we would just extend the 2x2 CNOT gate to:
TODO lazy to properly learn right now. Apparently you have to use the Kronecker product by the identity matrix. Also, zX-calculus appears to provide a powerful alternative method in some/all cases.
Quantum Processes and Computation course of the University of Oxford Updated 2024-12-15 +Created 1970-01-01
2022 page: www.cs.ox.ac.uk/teaching/courses/2022-2023/quantum/ (archive). Assignments are available:
- www.cs.ox.ac.uk/people/aleks.kissinger/courses/qpc2022/assignment1.pdf
- www.cs.ox.ac.uk/people/aleks.kissinger/courses/qpc2022/assignment2.pdf
- www.cs.ox.ac.uk/people/aleks.kissinger/courses/qpc2022/assignment3.pdf
- www.cs.ox.ac.uk/people/aleks.kissinger/courses/qpc2022/assignment4.pdf
- www.cs.ox.ac.uk/people/aleks.kissinger/courses/qpc2022/assignment5.pdf
- www.cs.ox.ac.uk/people/aleks.kissinger/courses/qpc2022/assignment6.pdf
2022 lecturer: Aleks Kissinger
The course would be better named ZX-calculus as it appears to be the only subject covered.
2022 page: www.cs.ox.ac.uk/teaching/courses/qsoft/ Half of the problems are Jupyter Notebooks, not bad.
As en.wikipedia.org/w/index.php?title=ZX-calculus&oldid=1071329204#Diagram_rewriting tries to explain but fails to deliver as usual consider the GHZ state represented as a quantum circuit.
How can we easily prove that that quantum circuit equals the state:?
The naive way would be to just do the matrix multiplication as explained at Section "Quantum computing is just matrix multiplication".
However, ZX-calculus provides a simpler way.
And even more importantly, sometimes it is the only way, because in a real circuit, we would not be able to do the matrix multiplication
What we do in ZX-calculus is we first transform the original quantum circuit into a ZX graph.
This is always possible, because we can describe how to do the conversion simply for any of the Clifford plus T gates, which is a set of universal quantum gates.
Then, after we do this transformation, we can start applying further transformations that simplify the circuit.
It has already been proven that there is no efficient algorithm for this (TODO source, someone said P-sharp complete best case)
But it has been proven in 2017 that any possible equivalence between quantum circuits can be reached by modifying ZX-calculus circuits.
There are only 7 transformation rules that we need, and all others can be derived from those, universality.
So, we can apply those rules to do the transformation shown in Wikipedia:
and one of those rules finally tells us that that last graph means our desired state:because it is a Z spider with and .
Bibliography:
- quantumcomputing.stackexchange.com/questions/9774/what-are-some-applications-of-the-zx-calculus
- github.com/zxcalc/book Picturing Quantum Software by Aleks Kissinger and John van de Wetering (2024), CC BY-NC-SA.