Skip to content

Commit

Permalink
fix(fock/pure): Fix interferometer typing
Browse files Browse the repository at this point in the history
Some typing errors have been fixed. The typing has to be consistent, especially
when calculating with tensorflow.
  • Loading branch information
Kolarovszki committed Feb 12, 2024
1 parent ba76d0c commit 207d1f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions piquasso/_backends/fock/pure/calculations/passive_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def passive_linear(

interferometer: np.ndarray = instruction._get_passive_block(
state._calculator, state._config
).astype(np.complex128)
).astype(state._config.complex_dtype)

subspace = state._get_subspace(dim=len(interferometer))

Expand Down Expand Up @@ -318,7 +318,7 @@ def interferometer_gradient(*upstream):
"ij,ij", upstream[i], fallback_np.conj(subspace_grad[i])
)

return calculator.np.array(full_kl_grad)
return calculator.np.array(full_kl_grad, dtype=interferometer.dtype)

return interferometer_gradient

Expand Down

0 comments on commit 207d1f3

Please sign in to comment.