From d066a6322303a50c0e44527b5898d7e4c19b3a3f Mon Sep 17 00:00:00 2001 From: Charles MOUSSA Date: Wed, 8 Jan 2025 13:15:00 +0100 Subject: [PATCH] rm dunder --- horqrux/api.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/horqrux/api.py b/horqrux/api.py index 209775a..b66f402 100644 --- a/horqrux/api.py +++ b/horqrux/api.py @@ -69,15 +69,15 @@ def sample( @singledispatch -def __ad_expectation_single_observable( +def _ad_expectation_single_observable( state: Any, observable: Primitive, values: dict[str, float], ) -> Any: - raise NotImplementedError("__ad_expectation_single_observable is not implemented") + raise NotImplementedError("_ad_expectation_single_observable is not implemented") -@__ad_expectation_single_observable.register +@_ad_expectation_single_observable.register def _( state: Array, observable: Primitive, @@ -92,7 +92,7 @@ def _( return inner(state, projected_state).real -@__ad_expectation_single_observable.register +@_ad_expectation_single_observable.register def _( state: DensityMatrix, observable: Primitive, @@ -124,7 +124,7 @@ def ad_expectation( Array: Expectation values. """ outputs = [ - __ad_expectation_single_observable( + _ad_expectation_single_observable( apply_gate(state, gates, values, OperationType.UNITARY), observable, values ) for observable in observables