Conversation
069cc84 to
590ae25
Compare
| sparse_circuit = sparse_prep.run(wfn_cas) | ||
| print(f"Regular isometry QASM:\n{regular_circuit.get_qasm()}") | ||
| print(f"Sparse isometry QASM:\n{sparse_circuit.get_qasm()}") | ||
| print(f"Regular isometry circuit:\n{regular_circuit.get_qiskit_circuit()}") |
There was a problem hiding this comment.
Why should this not continue to be QASM?
There was a problem hiding this comment.
The current flow generates circuit through Q#, which will go through Q# ->qir -> qiskit, without using QASM as an intermediate.
python/src/qdk_chemistry/algorithms/phase_estimation/IterativePhaseEstimation.qs
Outdated
Show resolved
Hide resolved
python/src/qdk_chemistry/algorithms/state_preparation/sparse_isometry.py
Outdated
Show resolved
Hide resolved
| n_qubits, | ||
| prune_classical_qubits=self._settings.get("prune_classical_qubits"), | ||
| ) | ||
| qir = qsharp.compile( |
There was a problem hiding this comment.
Is this something we always want? Can it be lazy/memoized in Circuit?
python/src/qdk_chemistry/algorithms/phase_estimation/iterative_phase_estimation.py
Show resolved
Hide resolved
.../src/qdk_chemistry/algorithms/time_evolution/controlled_circuit_mapper/ControlledPauliExp.qs
Outdated
Show resolved
Hide resolved
|
|
||
| from __future__ import annotations | ||
|
|
||
| import pyqir |
There was a problem hiding this comment.
We will need to add this to the dependencies
| def _on_call_instr(self, call: pyqir.Call) -> None: | ||
| """Handle call instructions.""" | ||
| # Handle CNOT alias (parent only dispatches cx) | ||
| if call.callee.name == "__quantum__qis__cnot__body": |
There was a problem hiding this comment.
This was an oversight on my part. The QDK always generates __quantum__qis__cx__body but there is an older code path in the PyQIR simple builder that produces __quantum__qis__cnot__body. If the intent of this code path is to accept arbitrary QIR then this extra check should be kept. If the intent is just to handle QIR that was compiled from Q# or OpenQASM via the QDK, then you can be sure that only the cx variant is produced.
cf19676 to
b2bdb2f
Compare
This PR implements Q# circuit operations for