From 6e94ca867f1d0b8f385bb05f3eaba42b7906141b Mon Sep 17 00:00:00 2001 From: Anurudh Peduri Date: Wed, 24 Jul 2024 15:31:15 -0700 Subject: [PATCH] fix classical call args --- qualtran/bloqs/rotations/phase_gradient.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qualtran/bloqs/rotations/phase_gradient.py b/qualtran/bloqs/rotations/phase_gradient.py index ce40575f0..53198e9d0 100644 --- a/qualtran/bloqs/rotations/phase_gradient.py +++ b/qualtran/bloqs/rotations/phase_gradient.py @@ -301,7 +301,10 @@ def apply(self, *args) -> Tuple[Union[int, np.integer, NDArray[np.integer]], ... if self.controlled_by == ctrl: x_fxp = self.x_dtype.float_to_fxp(x, raw=True) phase_grad_fxp = self.phase_dtype.float_to_fxp(phase_grad, raw=True) - out = self.on_classical_vals(x=x_fxp, phase_grad=phase_grad_fxp) + + ctrl_kwarg = {} if self.controlled_by is None else {'ctrl': ctrl} + out = self.on_classical_vals(x=x_fxp, phase_grad=phase_grad_fxp, **ctrl_kwarg) + phase_grad_out_fxp = out['phase_grad'] assert isinstance(phase_grad_out_fxp, Fxp) phase_grad_out = int(phase_grad_out_fxp.raw())