diff --git a/forest/benchmarking/direct_fidelity_estimation.py b/forest/benchmarking/direct_fidelity_estimation.py index 8f41fe8e..bef3ac9e 100644 --- a/forest/benchmarking/direct_fidelity_estimation.py +++ b/forest/benchmarking/direct_fidelity_estimation.py @@ -145,7 +145,7 @@ def generate_exhaustive_process_dfe_experiment(program: Program, qubits: list, qubits=qubits, in_states=[None, plusX, minusX, plusY, minusY, plusZ, minusZ], benchmarker=benchmarker)), - program=program, qubits=qubits) + program=program) return expr @@ -184,7 +184,7 @@ def generate_exhaustive_state_dfe_experiment(program: Program, qubits: list, qubits=qubits, in_states=[None, plusZ], benchmarker=benchmarker)), - program=program, qubits=qubits) + program=program) return expr @@ -253,7 +253,7 @@ def generate_monte_carlo_state_dfe_experiment(program: Program, qubits: List[int _monte_carlo_dfe(program=program, qubits=qubits, in_states=[None, plusZ], n_terms=n_terms, benchmarker=benchmarker)), - program=program, qubits=qubits) + program=program) return expr @@ -288,7 +288,7 @@ def generate_monte_carlo_process_dfe_experiment(program: Program, qubits: List[i _monte_carlo_dfe(program=program, qubits=qubits, in_states=[None, plusX, minusX, plusY, minusY, plusZ, minusZ], n_terms=n_terms, benchmarker=benchmarker)), - program=program, qubits=qubits) + program=program) return expr @@ -318,9 +318,9 @@ def acquire_dfe_data(qc: QuantumComputer, expr: TomographyExperiment, n_shots=10 program=expr.program, out_pauli=[str(e[0].out_operator) for e in expr], pauli_point_est=np.array([r.expectation for r in res]), - pauli_std_err=np.array([r.stddev for r in res]), + pauli_std_err=np.array([r.std_err for r in res]), cal_point_est=np.array([r.calibration_expectation for r in res]), - cal_std_err=np.array([r.calibration_stddev for r in res]), + cal_std_err=np.array([r.calibration_std_err for r in res]), dimension=2**len(expr.qubits), qubits=expr.qubits) diff --git a/forest/benchmarking/randomized_benchmarking.py b/forest/benchmarking/randomized_benchmarking.py index 0b03af3a..2d0d6ba3 100644 --- a/forest/benchmarking/randomized_benchmarking.py +++ b/forest/benchmarking/randomized_benchmarking.py @@ -287,7 +287,7 @@ def run(qc: QuantumComputer, seq: List[Program], subgraph: List[List[int]], num_ _rs = list(measure_observables(qc, tomo_exp, num_trials)) # Inelegant shim from state tomo refactor. To clean up! expectations=[r.expectation for r in _rs[1:]] - variances=[r.stddev ** 2 for r in _rs[1:]] + variances=[r.std_err ** 2 for r in _rs[1:]] results.append((expectations, variances)) return results diff --git a/forest/benchmarking/tests/test_process_tomography.py b/forest/benchmarking/tests/test_process_tomography.py index f4281955..c6c9f48a 100644 --- a/forest/benchmarking/tests/test_process_tomography.py +++ b/forest/benchmarking/tests/test_process_tomography.py @@ -114,7 +114,7 @@ def wfn_measure_observables(n_qubits, tomo_expt: TomographyExperiment): yield ExperimentResult( setting=setting, expectation=wfn.reset().do_program(prog).expectation(setting.out_operator), - stddev=0., + std_err=0., total_counts=1, # don't set to zero unless you want nans ) diff --git a/forest/benchmarking/tomography.py b/forest/benchmarking/tomography.py index 914d1a63..d316d985 100644 --- a/forest/benchmarking/tomography.py +++ b/forest/benchmarking/tomography.py @@ -74,7 +74,7 @@ def generate_state_tomography_experiment(program: Program, qubits: List[int]): :param qubits: The qubits to tomographize """ return PyQuilTomographyExperiment(settings=list(_state_tomo_settings(qubits)), - program=program, qubits=qubits) + program=program) def _sic_process_tomo_settings(qubits: Sequence[int]): @@ -144,7 +144,7 @@ def generate_process_tomography_experiment(program: Program, qubits: List[int], else: raise ValueError(f"Unknown basis {in_basis}") - return PyQuilTomographyExperiment(settings=list(func(qubits)), program=program, qubits=qubits) + return PyQuilTomographyExperiment(settings=list(func(qubits)), program=program) @dataclass @@ -181,7 +181,7 @@ def shim_pyquil_results_to_TomographyData(program, qubits, results: List[Experim in_ops=[r.setting.in_operator for r in results[1:]], out_ops=[r.setting.out_operator for r in results[1:]], expectations=[r.expectation for r in results[1:]], - variances=[r.stddev ** 2 for r in results[1:]], + variances=[r.std_err ** 2 for r in results[1:]], program=program, number_qubits=len(qubits), dimension=2 ** len(qubits), @@ -858,7 +858,7 @@ def _resample_expectations_with_beta(results, prior_counts=1): resampled_results += [ExperimentResult( setting=result.setting, expectation=resampled_expect, - stddev=result.stddev, + std_err=result.std_err, total_counts=result.total_counts, )] return resampled_results diff --git a/requirements.txt b/requirements.txt index e3c40015..bad7d369 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pyquil>=2.4.0 +pyquil>=2.7.0 numpy networkx pandas diff --git a/setup.py b/setup.py index a46d1511..046ea470 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ def find_forest_packages(): long_description_content_type="text/markdown", long_description=open('README.md').read(), install_requires=[ - 'pyquil>=2.4.0', + 'pyquil>=2.7.0', 'numpy', 'networkx', 'pandas',