Skip to content

Commit

Permalink
removes unnecesary import
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Quesada committed Apr 26, 2024
1 parent a684d94 commit 1ed51d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions thewalrus/internal_modes/fock_density_matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import warnings
import numpy as np
import numba
from scipy.special import factorial

from .._hafnian import nb_binom, nb_ix, find_kept_edges, f_from_matrix
from .utils import (
Expand Down Expand Up @@ -251,8 +250,8 @@ def density_matrix_single_mode(
pref
* haf_blocked(Aperm, blocks=new_blocks, repeats=patt_long)
/ (
np.prod(factorial(patt_long[1:-1]))
* np.sqrt(factorial(i) * factorial(j))
np.prod(fact[np.array(patt_long[1:-1])])
* np.sqrt(fact[i] * fact[j])
)
)
dm[i, j] = np.conj(dm[j, i])
Expand All @@ -262,7 +261,7 @@ def density_matrix_single_mode(
dm[i, i] = (
pref
* haf_blocked(A, blocks=blocks, repeats=patt_long)
/ np.prod(factorial(patt_long))
/ np.prod(fact[np.array(patt_long)])
)
if check_probabilities(np.diag(dm)) is False:
warnings.warn(
Expand Down

0 comments on commit 1ed51d9

Please sign in to comment.