Skip to content

Commit

Permalink
Remove unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
thangleiter committed Aug 19, 2019
1 parent ad22f16 commit 96189f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
17 changes: 6 additions & 11 deletions filter_functions/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,14 +923,11 @@ def error_transfer_matrix(
.. math::
\mathcal{\tilde{P}}_{ij}^{(1)} = \begin{cases}
\sum_{k\neq i}\bigl\langle u_{1,k}^2\bigr\rangle,
&\mathrm{if\;} i = j \\
-\frac{1}{2}\left(
\bigl\langle u_{1, i} u_{1, j}\bigr\rangle +
\bigl\langle u_{1, j} u_{1, i}\bigr\rangle
\right),
&\mathrm{if\;} i\neq j
\end{cases}.
\sum_{k\neq i}\bigl\langle u_{1,k}^2\bigr\rangle
&\mathrm{if\;} i = j, \\
-\langle u_{1, i} u_{1, j}\bigr\rangle
&\mathrm{if\;} i\neq j.
\end{cases}
Given the above expression of the error transfer matrix, the entanglement
infidelity is given by
Expand Down Expand Up @@ -960,9 +957,7 @@ def error_transfer_matrix(
# Single qubit case. Can use simplified expression
diag_mask = np.eye(N - 1, dtype=bool)
# Offdiagonal terms
P[..., 1:, 1:][..., ~diag_mask] = -(
u_kl[..., ~diag_mask] + u_kl.swapaxes(-1, -2)[..., ~diag_mask]
)/2
P[..., 1:, 1:][..., ~diag_mask] = -u_kl[..., ~diag_mask]
# Diagonal terms
for i in range(1, N):
P[..., i, i] = (u_kl[..., diag_mask][..., :i-1].sum(axis=-1) +
Expand Down
3 changes: 0 additions & 3 deletions tests/test_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_SE(self):
tau = np.pi
tau_pi = 1e-8
n = 1
d = 2

H_c, dt = testutil.generate_dd_hamiltonian(n, tau=tau, tau_pi=tau_pi,
dd_type='cpmg')
Expand Down Expand Up @@ -68,7 +67,6 @@ def test_6_pulse_CPMG(self):
tau = np.pi
tau_pi = 1e-9
n = 6
d = 2

H_c, dt = testutil.generate_dd_hamiltonian(n, tau=tau, tau_pi=tau_pi,
dd_type='cpmg')
Expand All @@ -89,7 +87,6 @@ def test_6_pulse_UDD(self):
omega = np.logspace(0, 3, 100)
omega = np.concatenate([-omega[::-1], omega])
n = 6
d = 2

H_c, dt = testutil.generate_dd_hamiltonian(n, tau=tau, tau_pi=tau_pi,
dd_type='udd')
Expand Down

0 comments on commit 96189f0

Please sign in to comment.