Skip to content

Commit

Permalink
chore: use program.remove_quil_t_instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jselig-rigetti committed Jan 26, 2024
1 parent 486b6e5 commit 0032719
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions forest/benchmarking/observable_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import networkx as nx
from networkx.algorithms.approximation.clique import clique_removal
from pyquil import Program
from pyquil.api import QuantumComputer
from pyquil.api import QuantumComputer, QVM
from pyquil.gates import RX, RZ, MEASURE, RESET
from pyquil.quilbase import Delay
from pyquil.paulis import PauliTerm, sI, is_identity
Expand Down Expand Up @@ -901,13 +901,8 @@ def estimate_observables(qc: QuantumComputer, obs_expt: ObservablesExperiment,
programs, meas_qubits = generate_experiment_programs(obs_expt, active_reset)
for prog, meas_qs, settings in zip(tqdm(programs, disable=not show_progress_bar), meas_qubits,
obs_expt):
# Remove `Delay` instructions for qvm-bound executions,
# where Quil-T instructions are not supported.
if 'qvm' in qc.name:
prog.instructions = [
instruction for instruction in prog.instructions
if not isinstance(instruction, Delay)
]
if isinstance(qc.qam, QVM):
prog = prog.remove_quilt_instructions()

results = qc.run_symmetrized_readout(prog, num_shots, symm_type, meas_qs or [0])

Expand Down

0 comments on commit 0032719

Please sign in to comment.