Skip to content

✨ Reuse already existing ancillary qubits instead of creating new ones #386

@TooMuchDakka

Description

@TooMuchDakka

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

No one assigned

    Labels

    c++Anything related to C++ codehelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions