-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quantum dynamic programming model #1302
Draft
marekgluza
wants to merge
46
commits into
master
Choose a base branch
from
qdp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An implementation by Jeongrak Son at NTU of the KAK decomposition based on the quantum control text book by D'Allesandro
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In https://arxiv.org/abs/2403.09187 by Jeongrak Son, Marek Gluza, Ryuji Takagi, Nelly H. Y. Ng a framework for quantum recursion implementation using memory has been proposed.
This PR is adding a model into Qibo which parallels that paper and allows to explore backend-agnostic implementations of quantum dynamic programming (QDP).
More specifically, even though QDP is general this PR focuses on functioning on the level of established procedures, in particular density-matrix exponentiation using quantum instruction qubit recycling by means of (quantum) measurement emulation, see https://arxiv.org/abs/2001.08838.
The generalization to hermitian-map exponentiation is anticipated and can easily follow by inheritance of the classess provided.
src/qibo/models/qdp/dynamic_programming.py is the key class file
@abstractmethod
which the user has to define:memory_usage_query_circuit
andmemory_call_circuit
A memory-usage query circuit is a$U =e^{i N}\in U(\mathcal H\otimes \mathcal H)$ implements the memory-usage query channel
$$\mathcal E_{s}^{\mathcal N,\rho}(\sigma) = Tr_{1}\left[e^{-iN s}\left(\rho\otimes\sigma\right)e^{iN s}\right]$$ $\rho$ and operating on $\sigma$ .
qibo.Circuit
whose unitary approximatesinstructed on
A memory_call_circuit uses a Trotter-Suzuki decomposition of the desired dynamic unitary channel by means of memory usage queries
$$\mathcal E_{\text{QDP}}^{\mathcal N,\rho,M} := \left(\mathcal E_{1/M}^{\mathcal N,\rho}\right)^{M} = e^{i\mathcal N(\rho)} (\sigma) e^{-i\mathcal N(\rho)}+ O\left(1/{M}\right)$$
Here
The approach take is to assume it is known how to compile unitaries generated by$N$ and then use this theory to implement the memory-call channel. We separate the nomenclature because tracing out generically will reduce purity of the working state $\sigma \mapsto \sigma'$ . Instead we make only small rotations and repeat them many times - asymptotically implementing a memory call, i.e. calling quantum information from memory and then based on this input revealed on runtime modifying the state of the working registers.
The implementation intricacies begin when constructively answering how to implement multiple memory-usage queries.
The specific issue is how to in practice bring in multiple quantum instruction states into play. There are 3 main child classes of AbstractQuantumDynamicProgramming, which have the
memory_call_circuit
defined based on the abstract memory_usage_query_circuit. They apply different methods to create the required number of copies of instruction qubits:Ultimately, any protocol withing the QDP framework that is to be executed on a Qibo backend is specified by
memory_usage_query_circuit
after inheriting from one of these 3 'transpiling' classes (transpiling in the abstract sense the logistics of providing quantum instructions; transpiling into a fixed architecture layout will be treated elsewhere).To evaluate the function, in this PR, we demonstrate DME (density matrix exponentiation), which appies$N$ in steps small angle given by the $SWAP$ gate which for 2 qubits is just the 2 qubit Heisenberg Hamiltonian after appropriate rescaling.$\rho$ .
We use QDPSequentialInstruction protocol for generating copies of instruction state
Checklist: