I have a code that essentially looks like this
# Density matrix simulator
sim = cirq.DensityMatrixSimulator(
split_untangled_states=True
)
# Simulate
result = sim.simulate(
circuit,
resolver,
initial_state=rho,
qubit_order=cirq.LineQubit.range(num_q)
)
My initial state rho
is a density matrix. However, cirq.validate_density_matrix(rho)
raises value error "The density matrix is not positive semidefinite.", but changing the default value of atol
from 1e-7 to 1e-6 removes this value error. Therefore I would like to tell DensityMatrixSimulator
to use atol
of 1e-6 when simulating the circuit. How can I do that?