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.

Quil output with writable classical memory

See original GitHub issue

Is your feature request related to a use case or problem? Please describe.

In QuilOutput, the measurement id convention returns PyQuil memory declarations that are read-only. From the PyQuil docs:

The only memory that is writeable is the region named ro, and only through MEASURE instructions. 
All other memory is read-only.

This means that measurements are always empty when you run any program from QuilOutput (unless you manually change the memory declarations and measurements).

Describe the solution you’d like

QuilOutput to return a program with writeable memory - namely, a program with a single memory declaration called "ro" with a number of bits equal to the number of measurements in the circuit, and all measurements writing into "ro".

[optional] Additional context (e.g. screenshots)

Current behavior:

import cirq

q = cirq.LineQubit(0)
circuit = cirq.Circuit(cirq.H(q), cirq.measure(q))
print(circuit.to_quil())

Output:

# Created using Cirq.

DECLARE m0 BIT[1]

H 0
MEASURE 0 m0[0]

Desired output (m0 -> ro):

# Created using Cirq.

DECLARE ro BIT[1]

H 0
MEASURE 0 ro[0]

[optional] Describe alternatives/workarounds you’ve considered

Asking the PyQuil folks to allow additional writable memory references… 🙃

What is the urgency from your perspective for this issue? Is it blocking important work?

P2 - we should do it in the next couple of quarters

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mpharrigancommented, Aug 25, 2021
0reactions
github-actions[bot]commented, Nov 13, 2021

Issue closed due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

(Doc) write about **the correct way** to store & display quill ...
Quill work with Delta. HTML from users is unsafe. Best way is to store Delta in the database and render it to HTML...
Read more >
Getting Started with Rich Text Editors in React - Bits and Pieces
Head to your App.js file and feel free to clear everything out of there. Then we'll import the ReactQuill component, as well as...
Read more >
Quill -> Markdown - CodePen
Adding Classes. In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template....
Read more >
API - Quill Rich Text Editor
Quill is a free, open source WYSIWYG editor built for the modern web. Completely customize it for any need with its modular architecture...
Read more >
Programs and Gates — pyQuil 3.3.2 documentation
To declare memory and write measurement readout data into it, write: ... Classical memory regions must be explicitly requested and named by a...
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