rigetti / pyquil

A Python library for quantum programming using Quil.
http://docs.rigetti.com
Apache License 2.0
1.4k stars 341 forks source link

Measure Observables optional preserve Quil #893

Open kylegulshen opened 5 years ago

kylegulshen commented 5 years ago

~It would be convenient to have the option to run native quil code without the quil_to_native_quil compilation step executed within measure observables.~

(Sohaib's) EDIT: Optionally protect input Quil program against any compiler optimizations when said program is fed into measure_observables

notmgsk commented 5 years ago

@kylegulshen what's the convenience/motivation?

msohaibalam commented 5 years ago

@kylegulshen Based off our discussion the other day, can we change this issue to say something like "optionally preserve quil commands without compiling them away"?

kylegulshen commented 5 years ago

I was suggesting 1) Changing the pauli prep and measure methods to use native quil 2) adding an argument that allows skipping quil_to_native_quil compilation step, which does the step by default 3) replacing run_and_measure with the lower-level run calls.

so that I could pass in a benchmarking routine and know that it wasn't changed in any relevant way by the compiler. I think we could also just add pragma preserves to all of the routines in forest-benchmarking. The forest-benchmarking plan is potentially changing since our last meeting, so it might be best to hold off on this issue until we have that sorted out.

msohaibalam commented 5 years ago

My fix for this was essentially going to be to optionally add pragma preserves. Do you specify the benchmarking routine in TomographyExperiment's program field? If so, pragma preserving should work.