Skip to content

Commit

Permalink
fix classical call args
Browse files Browse the repository at this point in the history
  • Loading branch information
anurudhp committed Jul 24, 2024
1 parent 2c741b4 commit 6e94ca8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qualtran/bloqs/rotations/phase_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 6e94ca8

Please sign in to comment.