text
stringlengths
0
116
):
> np.testing.assert_allclose(
arrays[key],
expected[key],
rtol=2e-5,
atol=2e-8,
err_msg=f"{key} disagrees with the independent characteristic-matrix calculation",
)
E AssertionError:
E Not equal to tolerance rtol=2e-05, atol=2e-08
E cavity_T_plus disagrees with the independent characteristic-matrix calculation
E Mismatched elements: 10575 / 19521 (54.2%)
E Max absolute difference among violations: 0.00018096
E Max relative difference among violations: 0.00142369
E ACTUAL: array([[0.001756, 0.001957, 0.00222 , ..., 0.001192, 0.001205, 0.001231],
E [0.001777, 0.001982, 0.002251, ..., 0.001202, 0.001217, 0.001246],
E [0.001798, 0.002008, 0.002282, ..., 0.001212, 0.00123 , 0.001261],...
E DESIRED: array([[0.001756, 0.001957, 0.00222 , ..., 0.001192, 0.001205, 0.001231],
E [0.001777, 0.001982, 0.002251, ..., 0.001202, 0.001217, 0.001246],
E [0.001798, 0.002008, 0.002282, ..., 0.001212, 0.00123 , 0.001261],...
test_outputs.py:335: AssertionError
___________ test_inference_and_controls_match_independent_reference ____________
def test_inference_and_controls_match_independent_reference() -> None:
arrays, _ = load_submission()
expected, _ = independent_reference()
for key in ("enantiomer_dct", "achiral_dct", "lossless_T", "lossless_R"):
> np.testing.assert_allclose(
arrays[key],
expected[key],
rtol=2e-5,
atol=2e-8,
err_msg=f"{key} does not match the independent control calculation",
)
E AssertionError:
E Not equal to tolerance rtol=2e-05, atol=2e-08
E enantiomer_dct does not match the independent control calculation
E Mismatched elements: 19517 / 19521 (100%)
E Max absolute difference among violations: 0.00285077
E Max relative difference among violations: 78.39062639
E ACTUAL: array([[-4.430720e-06, -5.416836e-06, -6.571157e-06, ..., -9.649346e-07,
E -3.346224e-06, -5.811317e-06],
E [-4.508465e-06, -5.511302e-06, -6.685991e-06, ..., -1.351596e-06,...
E DESIRED: array([[5.022444e-07, 5.273566e-07, 5.524688e-07, ..., 2.460997e-06,
E 2.486110e-06, 2.511222e-06],
E [5.122297e-07, 5.378412e-07, 5.634527e-07, ..., 2.509926e-06,...
test_outputs.py:356: AssertionError
______________ test_physical_invariants_and_internal_consistency _______________
def test_physical_invariants_and_internal_consistency() -> None:
arrays, _ = load_submission()
for prefix in ("cavity", "bare"):
for polarization in ("plus", "minus"):
transmission = arrays[f"{prefix}_T_{polarization}"]
reflection = arrays[f"{prefix}_R_{polarization}"]
assert np.min(transmission) >= -1e-10, f"{prefix} T_{polarization} is negative"
assert np.min(reflection) >= -1e-10, f"{prefix} R_{polarization} is negative"
assert np.max(transmission + reflection) <= 1.0 + 2e-6, f"{prefix} violates passivity"
reconstructed = differential_transmission(
arrays[f"{prefix}_T_plus"],
arrays[f"{prefix}_T_minus"],
)
np.testing.assert_allclose(arrays[f"{prefix}_dct"], reconstructed, rtol=2e-7, atol=2e-10)
np.testing.assert_allclose(
arrays["cavity_minus_bare_dct"],
arrays["cavity_dct"] - arrays["bare_dct"],
rtol=2e-7,
atol=2e-10,
)
np.testing.assert_allclose(
arrays["cavity_over_bare_mean_T"],
(arrays["cavity_T_plus"] + arrays["cavity_T_minus"]) / (arrays["bare_T_plus"] + arrays["bare_T_minus"]),
rtol=2e-7,
atol=2e-10,
)
> np.testing.assert_allclose(
arrays["cavity_R_plus"],
arrays["cavity_R_minus"],
rtol=2e-7,
atol=2e-9,
err_msg="The reciprocal normal-incidence cavity should not split reflectance by helicity",
)
E AssertionError:
E Not equal to tolerance rtol=2e-07, atol=2e-09
E The reciprocal normal-incidence cavity should not split reflectance by helicity
E Mismatched elements: 18146 / 19521 (93%)
E Max absolute difference among violations: 0.00073337
E Max relative difference among violations: 0.0019205
E ACTUAL: array([[0.920629, 0.917815, 0.914523, ..., 0.934664, 0.933269, 0.931802],
E [0.920429, 0.917583, 0.91425 , ..., 0.9344 , 0.932989, 0.931504],
E [0.920227, 0.917349, 0.913974, ..., 0.934133, 0.932706, 0.931201],...
E DESIRED: array([[0.920629, 0.917815, 0.914523, ..., 0.934664, 0.933269, 0.931803],
E [0.920429, 0.917583, 0.91425 , ..., 0.9344 , 0.93299 , 0.931504],
E [0.920227, 0.917349, 0.913974, ..., 0.934134, 0.932707, 0.931201],...
test_outputs.py:400: AssertionError
==================================== PASSES ====================================