Skip to content

Commit

Permalink
Use np.complex128 for simulating xeb circuits (#6672)
Browse files Browse the repository at this point in the history
* Use np.complex128 for simulating xeb circuits

* update test
  • Loading branch information
eliottrosenberg authored Jul 20, 2024
1 parent df20ade commit ee934fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cirq-core/cirq/experiments/xeb_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def simulate_2q_xeb_circuits(
# Need an actual object; not np.random or else multiprocessing will
# fail to pickle the closure object:
# https://github.com/quantumlib/Cirq/issues/3717
simulator = sim.Simulator(seed=np.random.RandomState())
simulator = sim.Simulator(seed=np.random.RandomState(), dtype=np.complex128)
_simulate_2q_xeb_circuit = _Simulate_2q_XEB_Circuit(simulator=simulator)

tasks = tuple(
Expand Down
2 changes: 1 addition & 1 deletion cirq-core/cirq/experiments/xeb_simulation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _ref_simulate_2q_xeb_circuit(task: Dict[str, Any]):
tcircuit = circuit[:circuit_depth]
tcircuit = cirq.resolve_parameters_once(tcircuit, param_resolver=param_resolver)

pure_sim = cirq.Simulator()
pure_sim = cirq.Simulator(dtype=np.complex128)
psi = pure_sim.simulate(tcircuit)
psi_vector = psi.final_state_vector
pure_probs = cirq.state_vector_to_probabilities(psi_vector)
Expand Down

0 comments on commit ee934fe

Please sign in to comment.