question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[discussion] Move the borders between QVM and QPU

See original GitHub issue

There are typically three stages in quantum programming

  1. Write and debug using wavefunction-based methods
  2. Run the program as if it were running on a real device, perhaps with a noise model
  3. Run the program on a device.

The current distinction between QVMConnection and QPUConnection groups (1,2) and makes (3) separate. This causes some API warts: the difference between the two run_and_measures, and the different behavior on the QVMConnection between run+MEASURE and run_and_measure.

I propose we make (1) separate and group (2,3). The quil paper specifies

The QAM may be implemented either classically or on quantum hardware. A classical implementation is called a Quantum Virtual Machine (QVM). We describe one such implementation in Section V-F. An implementation on quantum hardware is called a Quantum Processing Unit (QPU).

(h/t @tarballs-are-good ) so (2) should be named with the QVM moniker, (3) should continue to be named with the QPU moniker, and (1) should be re-named to not mention a QVM but rather stress the wavefunction simulation aspect.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
marcuspscommented, Apr 18, 2018

Is this just a discussion about naming conventions and constructor function signatures, or can we also debate the different behaviors of run when using QVM vs QPU?

I personally would want a strict behavioral equivalence between the QVM and the QPU, and just struggled with the fact that the QVM wanted MEASURE instructions in order to make the run meaningful, which was quite frustrating (and not well documented).

@mpharrigan @tarballs-are-good

2reactions
mpharrigancommented, Mar 14, 2018

Example of what this might look like:

program = Program([H(0)])

# (1)
simulator = WavefunctionSimulator()
wfn = simulator.wavefunction(program)
i = np.argmax(wfn.probabilities())
# ...

# (2)
qvm = QAM(device='qvm', noise=0.05)
prog_with_measures = measure_all(program)
bitstrings = qvm.run(prog_with_measures)
qvm_expectation = np.mean(function_that_operates_on_bitstrings(bitstrings))
# ...

# (3)
qpu = QAM(device='acorn')
bitstrings = qpu.run(prog_with_measures)
qpu_expectation = np.mean(function_that_operates_on_bitstrings(bitstrings))
# ...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently asked questions (FAQ) - Qubes OS
For example, it puts all of your application windows on the same desktop with special colored borders indicating the trust levels of their...
Read more >
qubes os system requirements - Philadelphia Mixing Solutions
There are three types of system requirements specified for Qubes OS: ... Our GUI infrastructure introduces only about 2,500 lines of C code...
Read more >
0001193125-22-246067 | 8-K | iXBRL Viewer | Rigetti Computing INC
“Working with Rigetti, we'll explore how combining the best of quantum and GPU-accelerated computing can help address this challenge.” ...
Read more >
Leading items [LWN.net]
A disagreement over get_mm_exe_file(): enforcing code quality by removing exports. Moving toward Qubes OS 4.1: what's coming in the next release of this...
Read more >
0001193125-12-162854.txt - SEC.gov
We describe these developments in more detail under “Supplemental Discussion of Federal Income Tax Consequences” on page S-41 of the accompanying ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found