are_circuits_equivalent

autoeis.utils.are_circuits_equivalent(circuit1: str, circuit2: str, rtol: float = 1e-05) bool

Checks if two circuit strings are equivalent.

Parameters:
  • circuit1 (str) – The first circuit string in CDC format. See here for details.

  • circuit2 (str) –

    The second circuit string in CDC format. See here for details.

  • rtol (float, optional) – The relative tolerance for the circuit equivalence check. See the Notes section for more details. Default is 1e-5.

Returns:

True if the circuits are equivalent, False otherwise.

Return type:

bool

Notes

This function uses an approximate heuristic, i.e., it evaluates the circuits at a set of random frequencies and checks if the results are close enough to be considered equivalent.