MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / assert_close

Function assert_close

python/tests/builder/test_optimizer.py:20–21  ·  view source on GitHub ↗
(want, got, tolerance=1.e-4)

Source from the content-addressed store, hash-verified

18# certain tolerance. If we make numpy a cudaq dependency,
19# this may be replaced in the future with `np.allclose`.
20def assert_close(want, got, tolerance=1.e-4) -> bool:
21 return abs(want - got) < tolerance
22
23
24# Define a custom gradient strategy that can be used on arbitrary

Calls

no outgoing calls

Tested by

no test coverage detected