Open pranavm1502 opened 2 years ago
Hello @pranavm1502! The output does not look unexpected to me; it took the QASM program and compiled it for a Rigetti architecture with an XY gate. If you want to compile for a specific quantum computer architecture, you need to construct and supply a QuantumComputer object.
The qubits the program is operating on are not extraneous either. The compiler chose qubits it thought would be better for the calculation.
Could you describe more to me what output you're aiming to get? It's probably a matter of configuring options.
(I should also add: The fact the input has 2 CZ gates and the output has 1 CZ + 2 XY is not good; there's no good reason for that, probably, and that ought to be investigated and fixed.)
Hi @stylewarning ! This code is being compiled for a specific Rigetti backend Aspen-M-1. The backend calibrations show the existence of a CZ gate for both the qubit pairs [24,23] and [24,25]. Naively I would expect the compiler to leave the circuit untouched since it is the shortest circuit of native gates.
Now it's possible that the compiler pulled in information about backend gate errors and determined that 2XY is better than 1CZ for that specific qubit pair ( Fid_XY = 97.83% ± 0.32% | Fidelity_CZ = 88.52% ± 1.04%). This is a fair behaviour. However, I would like to be able to disable such "noise-aware" compilation. Any ideas how to do that?
My immediate suggestion is to modify the QuantumComputer object to not have fidelity information, or at the very least, make the fidelities ideal. At present, I'm not aware of an option to say "here are fidelities, but ignore them", but it wouldn't be too hard to push that feature out if the developers thought it was a broadly useful idea.
It would also be possible to write a function in Python to take a QC object and strip it of that metadata. Do you think you could try that first? (Sorry, I'd try it for you but I'm away from my dev computer for now.)
Thanks! Sounds good. Pyquil 3 doesn't seem to allow a method to change the ISA for QuantumComputer. I will look more into this next week.
Issue Description
Converting a QASM2.0 circuit to
native_quil
does the not preserve the circuit. There are two obvious errors-Barrier
on the three qubits before measuring.Code Snippet
Error Output
Environment Context
I am running this code on the QCS server.
This issue has also been filed at the pyquil repo - https://github.com/rigetti/pyquil/issues/1445