Skip to content
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

Extend base/adaptive profile capabilities by performing classical computations while "offline" #2065

Open
DmitryVasilevsky opened this issue Dec 13, 2024 · 0 comments
Labels
enhancement New feature or request needs triage

Comments

@DmitryVasilevsky
Copy link
Contributor

DmitryVasilevsky commented Dec 13, 2024

A few important algorithms (such as VQE) are structured in the following way:

  1. Prepare quantum state using parameters
  2. Run quantum operations and measure results
  3. Analyze measured results and make adjustments to preparation parameters
  4. Repeat

Note that step (3) has only classical calculations, potentially complex, that won't work in base or adaptive profile. However, algorithm doesn't need to maintain coherent quantum state between iterations of the cycle. Such computations could be done on a classical computer between "shots" of quantum computation. Base profile setup should potentially be capable of doing this if classical computations are done on a device outside quantum computer.

Currently this can be done in Python with Q# used as a subroutine but cannot be done from within Q#.

One approach to allow this is to introduce 'procedure' (in addition to 'function' and 'operation'). Procedure would only allow to use classical computations and call into procedures, functions and operations, but functions and operations won't be allowed to call into procedures. Once procedure calls into operation, a new instance of quantum computing unit is started and completes all necessary quantum computation. No quantum state needs to be saved between invocation of operations from procedures.

Alternatively, compiler may be smart enough to detect this from the code. A quantum computing unit may be initialized only when the first operation is called that allocates qubits. Once this operation exits, quantum state is no longer accessible, and quantum computing unit may be shut down. All computations between invocations of quantum computing units can be done on classical computer without limitations.

@DmitryVasilevsky DmitryVasilevsky added enhancement New feature or request needs triage labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

1 participant