-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
c++Anything related to C++ codeAnything related to C++ codehelp wantedExtra attention is neededExtra attention is needed
Description
Problem Statement
Requesting ancillary qubits via the syrec::SyrecSynthesis::getConstantLine(...) or the syrec::SyrecSynthesis::getConstantLines(...) will always create new ancillary qubits in the internal quantum computation instead of reusing already existing ones.
Proposed Solution
- Requesting ancillary qubits should reuse already existing ones due to the total number of qubits supported on physical quantum computers being rather small.
- Assuming that only simulatable gates (simulatable by the
syrec::SimpleSimulation) are added to the quantum computation one could:- track the value of ancillary qubits since they are initialized to zero and if only used to store integer constants can easily be reset.
- Undo previous quantum operations that used the ancillary qubit as target qubit until the ancillary qubit has the value 0 again by replaying/readding all relevant quantum operations in reverse.
- For this to work one has to carefully consider whether the value of the target/control qubits of the relevant quantum operations has changed during the time that the ancillary qubit was last used and now (at the time an ancillary qubit is requested). Additionally, the undo of these operations could change the value of qubits other than the ancillary one.
Metadata
Metadata
Assignees
Labels
c++Anything related to C++ codeAnything related to C++ codehelp wantedExtra attention is neededExtra attention is needed