Quantum Dynamic Programming in Qibo
How to use quantum computers programmed by quantum information?
Can quantum states program a quantum computer?
Can quantum information be the source code?
What would it be good for?
Kay Giang - NTU Singapore
J. Son et al, arxiv:2403.09187
Introduction to
Dynamic Quantum Algorithm
What is a dynamic quantum algorithm?
Dynamic Quantum Algorithm
- Consider a data qubit \(\sigma\) and an instruction qubit \(\rho\)
- Make an infinitesimal rotation by applying partial SWAP (\(\delta\)SWAP) gate, realized by Heisenberg interaction
- Discard the instruction qubits and prepare a fresh copy of \(\rho\)
Toy model example: Density Matrix Eponentiation
Goal: Approximate the unitary \(e^{it\rho}\)
Kjaergaard et al., arxiv:2001.08838
Dynamic Quantum Algorithm
4. Repeat the partial SWAP and fresh preparation
5. If the infinitesimal rotation duration is \(dt\) then after \(M\) steps we will have
6. The circuit will be exactly the same even if we use different qubit states
Kjaergaard et al., arxiv:2001.08838
Density Matrix Exponentiation
- Density matrix \(\rho\) is Hermitian \(\to\) can use as operator
- In summary:
- DME implements an infinitesimal rotation about an axis defined by instruction qubit 𝜌 on data qubit 𝜎 (where \(\delta = \theta/N\)):\[\sigma\to e^{-i\rho\delta}\sigma e^{i\rho\delta}\]
- After Trotterization, DME implements: \(U = e^{-i\rho\theta}\)
- Again, this is dynamic because \(\rho\) is only determined at runtime
Dynamic Quantum Algorithm
- Quantum algorithms that are dynamic: their operation is revealed on runtime.
- Question 1: How to use quantum computers programmed by quantum information?
-
Answer: Using dynamic quantum algorithm, which:
- Take an unknown density matrix
- Design a circuit that will meaningfully use this quantum information as an instruction
Dynamic Quantum Algorithm
- Question 2: Can quantum information be the source code?
- Answer: Kimmel et al. (arxiv 1608.00281) shows that this model is basis of a universal model for quantum computation
- Questions 3: What would QDP be good for?
-
Answer:
- Example usage: QDP provide a universal circuit that compute the Schmidt spectrum
- QDP also gives more useful examples
Static vs Dynamic
- Usual quantum computing is static: To change operation, we have to change the circuit
- Dynamic quantum computing: To change operation, only need to change instruction qubit
Normal way we do quantum computing: Static
Dynamic Quantum Computing
Kjaergaard et al., arxiv:2001.08838
Existing literature
Kjaergaard et al., arxiv:2001.08838
Motivation for
Quantum Dynamic Programming
What is Quantum Dynamic Programming (QDP) good for?
What is a quantum recursion
- Definition:
- The recursive state is instructing the propagation
- Dynamic: The unitary is different for different states
-
Problems:
- What is a meaningful \(U(\psi)\)?
- To calculate \(\ket {\psi_2}\) will we need to recalculate \(\ket {\psi_1}\) and calculate \(U(\psi_1)\)?
- For higher order terms, do we need to recalculate all lower terms?
- Solution: QDP shows how to do it in a quantum coherent way.
Quantum recursion examples
- Examples of meaningful unitaries for quantum recursions:
- Grover rotation:
G(ψ1)=U0†G(ψ0)U0=id−2∣ψ1⟩⟨ψ1∣G^{(\psi_1)} = U_0^\dagger G^{(\psi_0)}U_0=\mathbb{id} - 2\ket{\psi_1}\bra{\psi_1} - Grover search: Add static unitaries Q and R that don’t depend on the state:
- Density Matrix Exponentiation: Give rise to dynamic Grover rotation implementation:
- Grover rotation:
\(G=id - 2\ket\psi\bra\psi\)
\(U^{(\psi)} = QG^{(\psi)}R\) with \(Q,R\in U(D)\)
Quantum recursion examples
- Reduced group commutator:
\[e^{isD}e^{it\rho}e^{-isD}\] - We can use this to diagonalize
eisDeitρe−isDe^{isD}e^{it\rho}e^{-isD}
Marek DBI paper, arxiv:2206.11772
QDP paper, arxiv:2403.09187
Unfolding quantum recursions
Consider Grover reflector: \(G=id - 2\ket\psi\bra\psi\)
\(Q,R \in U(D)\), initial state \(\ket{\psi_0}\), \(\ket{\psi_{k+1}} = QG^{(\psi_k)}R\ket{\psi_k}\)
However, it's more complicated to get \(\ket{\psi_2}\). To do this, we need to get \(U(\psi_1)\). Ordinary idea:
Reflection of \(\psi_1\) is the rotated reflection of \(\psi_0\)
To get \(\ket{\psi_1}\) is simple:
Motivation for QDP
- Unfolding the recursion make the depth grow exponentially
- Using placeholder memory is not straightforward with quantum computing
- Notice that the unitary \(U(\psi)\) depends on \(\ket\psi\). Can we use the state to steer the evolution?
- Quantum Dynamic Programming (QDP), a framework that uses copies of the recursive state to implement the recursion step unitary
- This is dynamic because the instruction state is revealed only on runtime
- QDP yields exponential reduction in circuit depth than when unfolding
Quantum Dynamic Programming
J. Son et al, arxiv:2403.09187
Quantum Dynamic Programming
- QDP speed up recursion of the form (single memory call):
\[ U^{(\mathcal{N},\rho)} = V_2e^{i\mathcal{N}(\rho)}V_1\] where \(\mathcal{N}\) is any Hermitian-preserving map - Memory call: Idealized transformation we want to make. It asks for memory (instruction state \(\rho\)).
- General case:
- Problem: We can't implement this naturally in qunatum mechanics
Quantum Dynamic Programming
- Solution: QDP approximate this memory call unitary:
- QDP does this by using memory usage query:
where \(N\) is the operator of the memory usage query, the partial transpose of the Choi matrix corresponding to \(\mathcal{N}\)- Consume (trace out) an instruction state
- Repeat this procedure M times, we obtain
Quantum Dynamic Programming
Example: Density Matrix Exponentiation
- Memory call unitary:
\[E^{(\mathcal{N},\rho)}(\sigma) = e^{i\rho\theta} \sigma e^{-i\rho\theta}\] - Memory call operator: \[\mathcal{N}\rho = \rho \to \mathcal{N} = id\]
- Memory usage query operator: \[N = \delta SWAP\]
- Memory usage query: \[\sigma\to\text{Tr}_\rho[e^{-i\text{SWAP}\delta}(\sigma\otimes\rho) e^{i\text{SWAP}\delta}]\]
Quantum Dynamic Programming
Example: Double bracket iteration
- Double bracket iteration step with instruction operator \(H\):
- Memory call operator: \(\mathcal{N} =-is[D,\rho]\)
- Memory usage query:
- Memory usage query operator:
Quantum Dynamic Programming
Example: Oblivious Schmidt decomposition
- Bipartite pure state \(|\psi\rangle\) has a Schmidt decomposition:
- Double bracket iteration of OSD:
- Memory usage query:
- Memory usage query operator:
Density Matrix Exponentiation (DME) in Qibo
Memory usage query in DME
- Goal: DME approximate the rotation (the memory call):
\[U = e^{-i\rho\theta}\] - DME replace the infinitesimal angle memory call unitary (where \(\delta = \theta/N\)): \[\sigma\to e^{-i\rho\delta}\sigma e^{i\rho\delta}\] by the memory usage query \[\sigma\to\text{Tr}_\rho[e^{-i\text{SWAP}\delta}(\sigma\otimes\rho) e^{i\text{SWAP}\delta}]\]
-
DME then does \(N\) memory usage queries (Trotterization):
DME flowchart
Problem of Entanglement
- To use quantum info from \(\rho\), we need it to interact and correlate with \(\sigma\)
- How do we avoid entanglement between \(\rho\) and \(\sigma\)?
- Example: the Bell state circuit create entanglement
How DME avoid entanglement
- DME uses a series of partial SWAP gate, realized by Heisenberg interaction: \(H_{\text{Heisenberg}} = e^{it{(XX + YY + ZZ)}}\)
- DME relies on the relation:
- Where, after the partial SWAP, by tracing out the instruction qubit, we get in first order the desired rotation
- The data qubit is in a pure state since the rotation is infinitesimal
DME in Qibo
DME tutorial notebook
QDP code structure
QDP code structure
There are 2 important parts of a QDP circuit:
- Memory call circuit:
- How many instruction qubit to use
- How to get N copies of the instruction qubit
- Memory usage query (circuit):
- Define the operator used to generate the unitary rotation
- (in the case of DME the 𝛿SWAP)
- Memory call circuit: How many instruction qubit to use, how to get N copies of the instruction qubit
- Memory usage query (circuit): Define the operator used to generate the unitary rotation (in the case of DME the 𝛿SWAP)
- 𝛿SWAP is decomposed into 3 CNOTs and single qubit rotations
Conclusion
Conclusion
- QDP applications:
- Useful for 2+ qubits
- We need 3 CNOTs per step
- DME has been realized only once
- Only for 2 qubits
- Maybe we can compile it better?
- Oblivious Schmidt Decomposition (OSD) is from March this year
- It is interesting already for 4 qubits
- Can be an original algorithm for demonstration
- DME and OSD implementation in Qibo
Copy of Quantum Dynamic Programming in Qibo
By Marek Gluza
Copy of Quantum Dynamic Programming in Qibo
I will present to you Quantum Dynamnic Programming, a new protocol that let us use quantum computers programmed by quantum infomation, and our pull-request on Github.
- 111