Open ncrubin opened 1 year ago
I can start implementing these.
MultiControl-X $C^{n}X$ costs $2(n-1)$ Toffoli and $n-1$ ancilla (Mike and Ike Figure 4.10)
There is a spectrum of constant factors that you can achieve depending upon the number and type of ancilla qubits available. Specifically,
n - 2
(burnable) clean ancillas: ~n
Toffoli's (using And
gate + measurement based uncomputation)n - 2
(non-burnable) clean ancillas: ~2n
Toffoli's (uncomputation using toffoli's, as given in Mike and Ike)n - 2
dirty ancillas: ~4n
Toffoli's (2 V chains of ~2n each)1
(burnable) clean ancilla: ~4n
Toffoli's (2 - $C^{n/2}$ chains using dirty borrowable qubits)1
(non-burnable) clean ancilla: ~6n
Toffoli's (3 - $C^{n/2}$ chains using dirty borrowable qubits)1
dirty ancilla: ~8n
(4 - $C^{n/2}$ chains using dirty borrowable qubits)A good summary and relevant constructions can be found in https://algassert.com/circuits/2015/06/05/Constructing-Large-Controlled-Nots.html
SelectSwap and MultiControl-X are implemented in #220
We will need to build up the primitives of the library and the associated costs. Here I will keep a running list of primitives I find that are useful and where to find their references. @tanujkhattar