Skip to content

Commit ee934fe

Browse files
Use np.complex128 for simulating xeb circuits (#6672)
* Use np.complex128 for simulating xeb circuits * update test
1 parent df20ade commit ee934fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cirq-core/cirq/experiments/xeb_simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def simulate_2q_xeb_circuits(
107107
# Need an actual object; not np.random or else multiprocessing will
108108
# fail to pickle the closure object:
109109
# https://github.com/quantumlib/Cirq/issues/3717
110-
simulator = sim.Simulator(seed=np.random.RandomState())
110+
simulator = sim.Simulator(seed=np.random.RandomState(), dtype=np.complex128)
111111
_simulate_2q_xeb_circuit = _Simulate_2q_XEB_Circuit(simulator=simulator)
112112

113113
tasks = tuple(

cirq-core/cirq/experiments/xeb_simulation_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _ref_simulate_2q_xeb_circuit(task: Dict[str, Any]):
7676
tcircuit = circuit[:circuit_depth]
7777
tcircuit = cirq.resolve_parameters_once(tcircuit, param_resolver=param_resolver)
7878

79-
pure_sim = cirq.Simulator()
79+
pure_sim = cirq.Simulator(dtype=np.complex128)
8080
psi = pure_sim.simulate(tcircuit)
8181
psi_vector = psi.final_state_vector
8282
pure_probs = cirq.state_vector_to_probabilities(psi_vector)

0 commit comments

Comments
 (0)