Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler bug in QV and QPU bug in readout. #188

Merged
merged 1 commit into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions forest/benchmarking/quantum_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pyquil.api import QuantumComputer
from pyquil.numpy_simulator import NumpyWavefunctionSimulator
from pyquil.quil import DefGate, Program
from pyquil.quil import DefGate, Program, Pragma
from rpcq.messages import TargetDevice
from rpcq._utils import RPCErrorError

Expand Down Expand Up @@ -41,7 +41,7 @@ def _naive_program_generator(qc: QuantumComputer, qubits: Sequence[int],
measure_qubits = qubits[:num_measure_qubits]

# create a simple program that uses the compiler to directly generate 2q gates from the matrices
prog = Program()
prog = Program(Pragma('INITIAL_REWIRING', ['"PARTIAL"']))
for layer_idx, (perm, layer) in enumerate(zip(permutations, gates)):
for gate_idx, gate in enumerate(layer):
# get the Quil definition for the new gate
Expand Down
6 changes: 4 additions & 2 deletions forest/benchmarking/readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def estimate_joint_confusion_in_set(qc: QuantumComputer, qubits: Sequence[int] =

if use_param_program:
# specify bitstring in parameterization at run-time
results = qc.run(executable, memory_map={reg_name: bitstring})
results = qc.run(executable,
memory_map={reg_name: [float(b) for b in bitstring]})
else:
# generate program that measures given bitstring on group, and append to start
bitstring_program = program_start + bitstring_prep(group, bitstring,
Expand Down Expand Up @@ -292,7 +293,8 @@ def estimate_joint_reset_confusion(qc: QuantumComputer, qubits: Sequence[int] =
# try preparation at most 10 times.
for _ in range(10):
# prepare the given bitstring and measure
result = qc.run(prep_executable, memory_map={reg_name: bitstring})
result = qc.run(prep_executable,
memory_map={reg_name: [float(b) for b in bitstring]})

# if the preparation is successful, move on to reset.
if np.array_equal(result[0], bitstring):
Expand Down