Skip to content

Commit

Permalink
Drop meaningless order-of-magnitude comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
thangleiter committed Oct 24, 2024
1 parent 4f18bc1 commit 2750848
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,24 +1033,15 @@ def test_cumulant_function(self):
cumulant_function_second_order = numeric.calculate_cumulant_function(
pulse, spectrum, omega, second_order=True
)
# Make sure first and second order are --roughly -- of same order
# of magnitude. Unlike the frequency shifts themselves, the
# second order contributions to the cumulant function vanish on the
# diagonal, whereas the first order contributions dominate. Hence,
# be quite lenient.
second_order_contribution = (cumulant_function_second_order
- cumulant_function_first_order)
rel = (np.linalg.norm(cumulant_function_first_order)
/ np.linalg.norm(second_order_contribution))

# Second order terms should be anti-hermitian
self.assertArrayAlmostEqual(second_order_contribution,
- second_order_contribution.transpose(0, 2, 1),
atol=1e-16)
self.assertEqual(cumulant_function_first_order.shape,
cumulant_function_second_order.shape)
self.assertLessEqual(rel, 200)
self.assertGreaterEqual(rel, 1/10)

def test_error_transfer_matrix(self):
"""Test raises of numeric.error_transfer_matrix."""
Expand Down

0 comments on commit 2750848

Please sign in to comment.