Skip to content

bloqade.lanes.utils.check_circuit

← Module overview

functioncheck_circuitsource

bloqade.lanes.utils.check_circuit

Signature
def check_circuit(squin_method: ir.Method[[], None], other_squin_method: ir.Method[[], None], atol: float = 1e-05, rtol: float = 1e-08) -> bool

Check if two squin methods are equivalent.

Parameters

NameTypeDefaultDescription
squin_methodir.Method[[], None]requiredThe first squin method. This method should not take any arguments and return None.
other_squin_methodir.Method[[], None]requiredThe second squin method. This method should not take any arguments and return None.
atolfloat1e-05Absolute tolerance for state vector comparison. Defaults to 1.0e-5.
rtolfloat1e-08Relative tolerance for state vector comparison. Defaults to 1

Returns

boolbool: True if the methods are equivalent, False otherwise.

Note

The methods should not perform any measurements. Otherwise, the state vectors may not be comparable.

source