text
stringlengths
0
116
=========================== short test summary info ============================
PASSED test_outputs.py::test_output_schema_shapes_coordinates_and_finiteness
PASSED test_outputs.py::test_summary_is_derived_from_saved_artifacts
FAILED test_outputs.py::test_cavity_and_bare_scattering_match_independent_physics
FAILED test_outputs.py::test_inference_and_controls_match_independent_reference
FAILED test_outputs.py::test_physical_invariants_and_internal_consistency - A...
========================= 3 failed, 2 passed in 0.13s ==========================
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-8.4.1, pluggy-1.6.0 -- /usr/local/bin/python3
rootdir: /verifier
collecting ... collected 5 items
test_outputs.py::test_output_schema_shapes_coordinates_and_finiteness PASSED [ 20%]
test_outputs.py::test_cavity_and_bare_scattering_match_independent_physics FAILED [ 40%]
test_outputs.py::test_inference_and_controls_match_independent_reference FAILED [ 60%]
test_outputs.py::test_physical_invariants_and_internal_consistency FAILED [ 80%]
test_outputs.py::test_summary_is_derived_from_saved_artifacts PASSED [100%]
=================================== FAILURES ===================================
__________ test_cavity_and_bare_scattering_match_independent_physics ___________
def test_cavity_and_bare_scattering_match_independent_physics() -> None:
arrays, _ = load_submission()
expected, _ = independent_reference()
for key in (
"cavity_T_plus",
"cavity_T_minus",
"cavity_R_plus",
"cavity_R_minus",
"bare_T_plus",
"bare_T_minus",
"bare_R_plus",
"bare_R_minus",
"cavity_over_bare_mean_T",
):
> 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: 11387 / 19521 (58.3%)
E Max absolute difference among violations: 0.00019977
E Max relative difference among violations: 0.00156745
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:386: 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: 19519 / 19521 (100%)
E Max absolute difference among violations: 0.00313897
E Max relative difference among violations: 95.94403052
E ACTUAL: array([[-9.782028e-06, -1.108710e-05, -1.259755e-05, ..., -4.448458e-06,
E -7.042205e-06, -9.722649e-06],
E [-9.921272e-06, -1.124832e-05, -1.278532e-05, ..., -4.897767e-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:407: 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)