diffpes.types tests

Validation and regression tests for diffpes.types.

Test the public scalar type aliases.

Extended Summary

Maintains a source-mirroring test module for the annotation-only definitions in diffpes.types.aliases. The typed public APIs exercise these aliases at runtime throughout the test suite.

Validate band, projection, spin, and ARPES carriers and factories.

The cases cover JAX PyTree behavior, eager and compiled construction, gradient-transparent validation, optional spin and OAM data, and shape and finiteness rejection contracts.

class tests.test_diffpes.test_types.test_bands.TestBandStructure[source]

Bases: object

Validate BandStructure as a JAX PyTree.

Eigenvalues, k-points, weights, and the Fermi energy must remain numerical leaves with stable dimensions through JAX transformations.

See:

BandStructure

test_pytree_round_trip() None[source]

Preserve all band fields through JAX reconstruction.

The check compares a two-point, two-band structure and its nonuniform k-point weights before and after a PyTree round trip.

Notes

The test constructs the carrier through its factory, flattens and unflattens it with JAX, and compares every array leaf with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestOrbitalProjection[source]

Bases: object

Validate OrbitalProjection optional leaves.

Projection weights must remain present while omitted spin and OAM arrays remain empty subtrees.

See:

OrbitalProjection

test_preserves_absent_optional_fields() None[source]

Store a nine-orbital projection with no spin or OAM data.

The check verifies the exact projection shape and both None sentinels for a non-spin calculation.

Notes

The test constructs one projection through its public factory and uses Chex for the array shape plus direct identity checks for optional fields.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestSpinOrbitalProjection[source]

Bases: object

Validate SpinOrbitalProjection as a PyTree.

Mandatory spin projections and optional orbital angular momentum must survive JAX reconstruction with their component axes intact.

See:

SpinOrbitalProjection

test_pytree_round_trip_with_oam() None[source]

Preserve spin and OAM arrays through JAX reconstruction.

The check uses six spin channels and three OAM components for a two-point, three-band, one-atom projection.

Notes

The test constructs the spin carrier through its factory, performs a JAX tree round trip, and compares all three array leaves with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestSpinBandStructure[source]

Bases: object

Validate SpinBandStructure as a JAX PyTree.

Up- and down-spin eigenvalues must share their k-point coordinates and survive reconstruction together.

See:

SpinBandStructure

test_pytree_round_trip() None[source]

Preserve both spin channels through JAX reconstruction.

The check compares two five-by-three eigenvalue arrays and their scalar Fermi energy before and after a PyTree round trip.

Notes

The test constructs the spin-resolved carrier, applies JAX flatten and unflatten, and compares both energy channels with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestArpesSpectrum[source]

Bases: object

Validate ArpesSpectrum array storage.

The momentum-energy intensity map must retain its association with the strictly increasing energy axis.

See:

ArpesSpectrum

test_stores_intensity_and_energy_axis() None[source]

Preserve a two-point, eight-energy-bin ARPES spectrum.

The check verifies the exact two-dimensional intensity and one-dimensional energy-axis shapes.

Notes

The test constructs the spectrum through its public factory and checks both numerical dimensions with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestMakeBandStructure(*args, **kwargs) None[source]

Bases: TestCase

Validate make_band_structure() under JAX.

The factory must supply uniform weights, normalize scalar dtype, preserve gradients, and reject non-finite eigenvalues in eager and compiled modes.

See:

make_band_structure()

test_rejects_nonfinite_eigenvalues() None[source]

Reject a NaN eigenvalue in eager and compiled execution.

The check gates the value-threaded eqx.error_if validation rather than allowing a poisoned carrier to escape.

Notes

The test calls the raw and eqx.filter_jit factories with one NaN eigenvalue and matches the same runtime diagnostic in both modes.

Return type:

None

test_validation_preserves_gradient() None[source]

Preserve the unit gradient through valid eigenvalue checking.

The derivative of the sum of two validated eigenvalues must match the direct array-sum derivative exactly.

Notes

The test differentiates an independently defined sum through the carrier factory and compares it with jax.grad(jnp.sum) using Chex.

Return type:

None

test_constructs_uniform_weights__with_jit() None

Construct uniform weights in eager and compiled execution.

The check expects eight unit weights and a scalar JAX Fermi energy for an eight-point, three-band input.

Notes

The test wraps the public factory with self.variant and compares output shapes, weights, and scalar array type with Chex.

Return type:

None

test_constructs_uniform_weights__without_jit() None

Construct uniform weights in eager and compiled execution.

The check expects eight unit weights and a scalar JAX Fermi energy for an eight-point, three-band input.

Notes

The test wraps the public factory with self.variant and compares output shapes, weights, and scalar array type with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestMakeOrbitalProjection[source]

Bases: object

Validate make_orbital_projection().

The factory must accept compatible spin data and reject malformed orbital axes or negative projection probabilities.

See:

make_orbital_projection()

test_stores_optional_spin() None[source]

Preserve the six-channel optional spin projection array.

The check verifies a four-point, three-band, one-atom spin array shape alongside the mandatory nine-orbital weights.

Notes

Supplies compatible projection and spin arrays to the public factory and checks the stored spin dimensions with Chex.

Return type:

None

test_rejects_invalid_projection_values() None[source]

Reject a wrong orbital axis and negative projection weights.

The check covers the static nine-orbital convention and the traced nonnegative-probability contract.

Notes

The test uses the rejection helper with an eight-orbital tensor and then with a negative nine-orbital tensor, matching each diagnostic.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestMakeSpinOrbitalProjection[source]

Bases: object

Validate make_spin_orbital_projection().

The spin-specific factory must require compatible six-channel spin data and preserve an optional three-component OAM array.

See:

make_spin_orbital_projection()

test_stores_explicit_oam() None[source]

Preserve a three-component orbital-angular-momentum array.

The check verifies the 2 x 3 x 1 x 3 OAM shape and float64 dtype after factory normalization.

Notes

Supplies compatible projection, spin, and OAM arrays and checks the optional output leaf with Chex and a dtype comparison.

Return type:

None

test_rejects_negative_projection_values() None[source]

Reject negative orbital probabilities with valid spin dimensions.

The check isolates the traced nonnegative constraint of the spin-aware factory.

Notes

Supplies a negative nine-orbital tensor and a compatible zero spin tensor, then matches the factory’s probability diagnostic.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestMakeSpinBandStructure[source]

Bases: object

Validate make_spin_band_structure().

The factory must align both spin channels with one k-point mesh and reject negative integration weights.

See:

make_spin_band_structure()

test_constructs_aligned_spin_channels() None[source]

Construct equal-shape up- and down-spin eigenvalue arrays.

The check verifies both channels retain the requested four-point, two-band dimensions.

Notes

Supplies finite spin channels and common k-points, then checks their carrier shapes with Chex.

Return type:

None

test_rejects_negative_weights() None[source]

Reject a negative spin-band integration weight.

The check isolates the traced nonnegative-weight contract for one k-point and one band in each spin channel.

Notes

The test uses the rejection helper with compatible spin arrays and a single negative weight, matching the factory diagnostic.

Return type:

None

class tests.test_diffpes.test_types.test_bands.TestMakeArpesSpectrum[source]

Bases: object

Validate make_arpes_spectrum().

The factory must preserve intensity dimensions and reject non-increasing energy coordinates.

See:

make_arpes_spectrum()

test_constructs_spectrum_shapes() None[source]

Construct ten momentum points over 100 energy bins.

The check gates the exact two-dimensional intensity and one-dimensional energy-axis shapes after float64 normalization.

Notes

Supplies a zero intensity map and linearly spaced energy axis, then checks both output dimensions with Chex.

Return type:

None

test_rejects_unsorted_energy_axis() None[source]

Reject repeated ARPES energy coordinates.

The check verifies strict energy ordering independently of the finite intensity map.

Notes

Supplies two equal energy coordinates and matches the traced ordering diagnostic through the shared rejection helper.

Return type:

None

Test the JAX-native certification carrier contract.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_types.test_certification.TestArtifactref[source]

Bases: object

Verify ArtifactRef.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

ArtifactRef

test_public_symbol_has_expected_kind() None[source]

Expose ArtifactRef through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestCertificationclaim[source]

Bases: object

Verify CertificationClaim.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

CertificationClaim

test_public_symbol_has_expected_kind() None[source]

Expose CertificationClaim through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestCertificationcontext[source]

Bases: object

Verify CertificationContext.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

CertificationContext

test_public_symbol_has_expected_kind() None[source]

Expose CertificationContext through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestCheckfunction[source]

Bases: object

Verify CheckFunction.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

CheckFunction

test_public_symbol_has_expected_kind() None[source]

Expose CheckFunction through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestCertifiedresult[source]

Bases: object

Verify CertifiedResult.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

CertifiedResult

test_public_symbol_has_expected_kind() None[source]

Expose CertifiedResult through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_complete_result_round_trips_through_filter_jit() None[source]

Preserve the complete nested PyTree through compiled execution.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestConventionref[source]

Bases: object

Verify ConventionRef.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

ConventionRef

test_public_symbol_has_expected_kind() None[source]

Expose ConventionRef through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestDependencymap[source]

Bases: object

Verify DependencyMap.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

DependencyMap

test_public_symbol_has_expected_kind() None[source]

Expose DependencyMap through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestDerivativeevidence[source]

Bases: object

Verify DerivativeEvidence.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

DerivativeEvidence

test_public_symbol_has_expected_kind() None[source]

Expose DerivativeEvidence through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestDomainpredicate[source]

Bases: object

Verify DomainPredicate.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

DomainPredicate

test_public_symbol_has_expected_kind() None[source]

Expose DomainPredicate through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestDomainresult[source]

Bases: object

Verify DomainResult.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

DomainResult

test_public_symbol_has_expected_kind() None[source]

Expose DomainResult through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestEvidenceref[source]

Bases: object

Verify EvidenceRef.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

EvidenceRef

test_public_symbol_has_expected_kind() None[source]

Expose EvidenceRef through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestEvidencereport[source]

Bases: object

Verify EvidenceReport.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

EvidenceReport

test_public_symbol_has_expected_kind() None[source]

Expose EvidenceReport through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestExecutionmanifest[source]

Bases: object

Verify ExecutionManifest.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

ExecutionManifest

test_public_symbol_has_expected_kind() None[source]

Expose ExecutionManifest through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestForwardcertificate[source]

Bases: object

Verify ForwardCertificate.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

ForwardCertificate

test_public_symbol_has_expected_kind() None[source]

Expose ForwardCertificate through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_complete_graph_has_traced_numerical_leaves() None[source]

Verify every dynamic leaf in a complete certificate is a JAX array.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test constructs the shared complete fixture and inspects its flattened JAX leaves while static vocabulary remains outside the numerical tree.

Return type:

None

test_static_vocabulary_is_absent_from_numerical_leaves() None[source]

Keep identifiers static while retaining all numerical evidence.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestForwardmodelspec[source]

Bases: object

Verify ForwardModelSpec.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

ForwardModelSpec

test_public_symbol_has_expected_kind() None[source]

Expose ForwardModelSpec through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestInformationspectrum[source]

Bases: object

Verify InformationSpectrum.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

InformationSpectrum

test_public_symbol_has_expected_kind() None[source]

Expose InformationSpectrum through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestPolicyreport[source]

Bases: object

Verify PolicyReport.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

PolicyReport

test_public_symbol_has_expected_kind() None[source]

Expose PolicyReport through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestRegisteredmodel[source]

Bases: object

Verify RegisteredModel.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

RegisteredModel

test_public_symbol_has_expected_kind() None[source]

Expose RegisteredModel through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestRegisteredtransformation[source]

Bases: object

Verify RegisteredTransformation.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

RegisteredTransformation

test_public_symbol_has_expected_kind() None[source]

Expose RegisteredTransformation through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestRegistryreport[source]

Bases: object

Verify RegistryReport.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

RegistryReport

test_public_symbol_has_expected_kind() None[source]

Expose RegistryReport through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestRegistrysnapshot[source]

Bases: object

Verify RegistrySnapshot.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

RegistrySnapshot

test_public_symbol_has_expected_kind() None[source]

Expose RegistrySnapshot through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestReproductionreport[source]

Bases: object

Verify ReproductionReport.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

ReproductionReport

test_public_symbol_has_expected_kind() None[source]

Expose ReproductionReport through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestSensitivitymap[source]

Bases: object

Verify SensitivityMap.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

SensitivityMap

test_public_symbol_has_expected_kind() None[source]

Expose SensitivityMap through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestTransformationrecord[source]

Bases: object

Verify TransformationRecord.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

TransformationRecord

test_public_symbol_has_expected_kind() None[source]

Expose TransformationRecord through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestVerificationreport[source]

Bases: object

Verify VerificationReport.

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

VerificationReport

test_public_symbol_has_expected_kind() None[source]

Expose VerificationReport through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeArtifactRef[source]

Bases: object

Verify make_artifact_ref().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_artifact_ref()

test_public_symbol_has_expected_kind() None[source]

Expose make_artifact_ref through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeCertificationClaim[source]

Bases: object

Verify make_certification_claim().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_certification_claim()

test_public_symbol_has_expected_kind() None[source]

Expose make_certification_claim through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_continuous_claim_evidence_is_differentiable() None[source]

Differentiate a smooth residual and margin through its factory.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeCertificationContext[source]

Bases: object

Verify make_certification_context().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_certification_context()

test_public_symbol_has_expected_kind() None[source]

Expose make_certification_context through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_context_cross_validates_model_identity() None[source]

Reject prepared contexts that combine different model identities.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeCertifiedResult[source]

Bases: object

Verify make_certified_result().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_certified_result()

test_public_symbol_has_expected_kind() None[source]

Expose make_certified_result through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_certified_envelope_preserves_primal_jvp_and_vjp() None[source]

Show that attaching a certificate does not alter model derivatives.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeConventionRef[source]

Bases: object

Verify make_convention_ref().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_convention_ref()

test_public_symbol_has_expected_kind() None[source]

Expose make_convention_ref through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeDependencyMap[source]

Bases: object

Verify make_dependency_map().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_dependency_map()

test_public_symbol_has_expected_kind() None[source]

Expose make_dependency_map through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeDerivativeEvidence[source]

Bases: object

Verify make_derivative_evidence().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_derivative_evidence()

test_public_symbol_has_expected_kind() None[source]

Expose make_derivative_evidence through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeDomainPredicate[source]

Bases: object

Verify make_domain_predicate().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_domain_predicate()

test_public_symbol_has_expected_kind() None[source]

Expose make_domain_predicate through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeDomainResult[source]

Bases: object

Verify make_domain_result().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_domain_result()

test_public_symbol_has_expected_kind() None[source]

Expose make_domain_result through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_domain_results_vmap_with_traced_status_and_margin() None[source]

Batch domain checks without concretizing status arrays.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeEvidenceRef[source]

Bases: object

Verify make_evidence_ref().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_evidence_ref()

test_public_symbol_has_expected_kind() None[source]

Expose make_evidence_ref through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_factories_reject_bad_numerical_shapes_and_tolerances() None[source]

Reject malformed evidence eagerly and through compiled execution.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_empty_evidence_is_rejected() None[source]

Reject evidence without a numerical measurement.

Evidence verification requires a defined residual norm.

Notes

All four numerical vectors have the same invalid zero length.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeEvidenceReport[source]

Bases: object

Verify make_evidence_report().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_evidence_report()

test_public_symbol_has_expected_kind() None[source]

Expose make_evidence_report through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeExecutionManifest[source]

Bases: object

Verify make_execution_manifest().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_execution_manifest()

test_public_symbol_has_expected_kind() None[source]

Expose make_execution_manifest through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeForwardCertificate[source]

Bases: object

Verify make_forward_certificate().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_forward_certificate()

test_public_symbol_has_expected_kind() None[source]

Expose make_forward_certificate through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_certificate_rejects_cross_record_inconsistency() None[source]

Reject policy, dependency, and duplicate identity mismatches.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeForwardModelSpec[source]

Bases: object

Verify make_forward_model_spec().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_forward_model_spec()

test_public_symbol_has_expected_kind() None[source]

Expose make_forward_model_spec through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_factories_reject_malformed_static_structure() None[source]

Reject empty identities, invalid JSON, and overlapping path classes.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeInformationSpectrum[source]

Bases: object

Verify make_information_spectrum().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_information_spectrum()

test_public_symbol_has_expected_kind() None[source]

Expose make_information_spectrum through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakePolicyReport[source]

Bases: object

Verify make_policy_report().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_policy_report()

test_public_symbol_has_expected_kind() None[source]

Expose make_policy_report through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeRegisteredModel[source]

Bases: object

Verify make_registered_model().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_registered_model()

test_public_symbol_has_expected_kind() None[source]

Expose make_registered_model through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeRegisteredTransformation[source]

Bases: object

Verify make_registered_transformation().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_registered_transformation()

test_public_symbol_has_expected_kind() None[source]

Expose make_registered_transformation through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeRegistryReport[source]

Bases: object

Verify make_registry_report().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_registry_report()

test_public_symbol_has_expected_kind() None[source]

Expose make_registry_report through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeRegistrySnapshot[source]

Bases: object

Verify make_registry_snapshot().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_registry_snapshot()

test_public_symbol_has_expected_kind() None[source]

Expose make_registry_snapshot through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeReproductionReport[source]

Bases: object

Verify make_reproduction_report().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_reproduction_report()

test_public_symbol_has_expected_kind() None[source]

Expose make_reproduction_report through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeSensitivityMap[source]

Bases: object

Verify make_sensitivity_map().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_sensitivity_map()

test_public_symbol_has_expected_kind() None[source]

Expose make_sensitivity_map through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeTransformationRecord[source]

Bases: object

Verify make_transformation_record().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_transformation_record()

test_public_symbol_has_expected_kind() None[source]

Expose make_transformation_record through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeVerificationReport[source]

Bases: object

Verify make_verification_report().

The cases cover the public carrier or factory contract in JAX PyTrees.

See:

make_verification_report()

test_public_symbol_has_expected_kind() None[source]

Expose make_verification_report through its canonical types package path.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestArtifactResolver[source]

Bases: object

Verify ArtifactResolver.

The case checks the canonical types package path for the resolver alias.

See:

ArtifactResolver

test_public_alias_is_available() None[source]

Expose the artifact resolver alias from the types package.

The public package must provide one canonical alias object.

Notes

The test resolves the alias by its exact public name.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestRegistrationHandshake[source]

Bases: object

Verify RegistrationHandshake.

The case checks the canonical type identity for registration requirements.

See:

RegistrationHandshake

test_public_type_is_an_equinox_module() None[source]

Expose the handshake type as an Equinox module class.

The carrier must use the project PyTree base class.

Notes

The test checks class inheritance through the canonical package path.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestHandshakeReport[source]

Bases: object

Verify HandshakeReport.

The case checks the JAX-native report carrier for handshake validation.

See:

HandshakeReport

test_public_type_is_an_equinox_module() None[source]

Expose the handshake report as an Equinox module class.

The carrier must use the project PyTree base class.

Notes

The test checks class inheritance through the canonical package path.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestWaiverRecord[source]

Bases: object

Verify WaiverRecord.

The case checks the static carrier for a bounded policy waiver.

See:

WaiverRecord

test_public_type_is_an_equinox_module() None[source]

Expose the waiver record as an Equinox module class.

The carrier must use the project PyTree base class.

Notes

The test checks class inheritance through the canonical package path.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestWaiverReport[source]

Bases: object

Verify WaiverReport.

The case checks the JAX-native carrier for temporal waiver validation.

See:

WaiverReport

test_public_type_is_an_equinox_module() None[source]

Expose the waiver report as an Equinox module class.

The carrier must use the project PyTree base class.

Notes

The test checks class inheritance through the canonical package path.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeRegistrationHandshake[source]

Bases: object

Verify make_registration_handshake().

The case checks construction of declarative owner requirements.

See:

make_registration_handshake()

test_factory_builds_exact_owner() None[source]

Build a handshake with one exact required model identity.

The factory must retain each static identity without modification.

Notes

The test compares the static owner and model reference fields.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeHandshakeReport[source]

Bases: object

Verify make_handshake_report().

The case checks the JAX Boolean outcome and static missing references.

See:

make_handshake_report()

test_factory_retains_missing_references() None[source]

Build an incomplete report with one missing evidence identity.

The report must retain the missing identity and false Boolean leaf.

Notes

The test checks both the Boolean leaf and static identity tuple.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeWaiverRecord[source]

Bases: object

Verify make_waiver_record().

The case checks construction of a bounded policy-waiver declaration.

See:

make_waiver_record()

test_factory_retains_absolute_utc_limits() None[source]

Build a waiver with explicit issue and expiry times.

The factory must retain both absolute UTC strings exactly.

Notes

The test compares the two static UTC fields exactly.

Return type:

None

class tests.test_diffpes.test_types.test_certification.TestMakeWaiverReport[source]

Bases: object

Verify make_waiver_report().

The case checks the JAX Boolean outcomes for temporal validation.

See:

make_waiver_report()

test_factory_retains_valid_and_active_outcomes() None[source]

Build a valid and active report without errors.

The report must contain two true scalar JAX leaves.

Notes

The test converts both scalar JAX leaves to Boolean values.

Return type:

None

Validate centralized parser, orbital, and tabulated-data constants.

The cases check immutable VASP conventions and alignment of the bundled photoionization cross-section rows against independent shape relationships.

class tests.test_diffpes.test_types.test_constants.TestOrbitalConstants[source]

Bases: object

Validate the shared VASP orbital-ordering constants.

Indices, slices, and direction rows must describe one nine-orbital basis with the scalar orbital first.

See:

ORBITAL_INDEX

See:

ORBITAL_DIRS_NORMALIZED

test_share_one_orbital_ordering() None[source]

Keep orbital indices, slices, and direction rows aligned.

The check verifies nine immutable indices, the standard p and d slices, and a zero direction for the scalar orbital.

Notes

The test compares the public mapping and slice constants exactly, then uses Chex for the direction-table shape and scalar-orbital row.

Return type:

None

class tests.test_diffpes.test_types.test_constants.TestParserConstants[source]

Bases: object

Validate immutable parser tokens and angular-momentum bounds.

The tests verify shared coordinate selectors and the maximum orbital angular momentum. Parsers do not define local values for these conventions.

See:

COORDINATE_MODE_TOKENS

See:

L_MAX

test_tokens_are_immutable_conventions() None[source]

Preserve the coordinate-token set and maximum angular momentum.

The check expects a frozen four-token convention and L_MAX=4.

Notes

The test compares the public token container type and contents plus the integer angular-momentum bound against independent literal values.

Return type:

None

class tests.test_diffpes.test_types.test_constants.TestCrossSectionTables[source]

Bases: object

Validate alignment of the bundled photoionization tables.

Every s-, p-, and d-channel cross section must provide one value at each shared photon-energy node.

See:

CROSS_SECTION_ENERGIES

test_channel_rows_share_energy_shape() None[source]

Align every cross-section channel with the energy coordinates.

The check verifies three energy nodes and an equal one-dimensional shape for every angular-momentum channel.

Notes

The test iterates over the three independent public channel arrays and uses Chex to compare each shape with the energy table.

Return type:

None

Validate workflow-context storage and cross-carrier consistency.

The cases cover the immutable context boundary and rejection of band and projection dimensions that cannot describe the same simulation.

class tests.test_diffpes.test_types.test_context.TestWorkflowContext[source]

Bases: object

Validate WorkflowContext field storage.

The carrier must keep compatible bands and projections together while retaining absent optional metadata as None.

See:

WorkflowContext

test_stores_compatible_members() None[source]

Preserve compatible workflow members and optional defaults.

The check verifies carrier identity and the two absent optional fields for a one-k-point, one-band workflow.

Notes

The test builds both members with their public factories, constructs the context, and compares the stored objects and None sentinels.

Return type:

None

class tests.test_diffpes.test_types.test_context.TestMakeWorkflowContext[source]

Bases: object

Validate make_workflow_context().

The factory must reject band and projection carriers with inconsistent k-point or band dimensions.

See:

make_workflow_context()

test_rejects_band_projection_mismatch() None[source]

Reject workflow members with inconsistent K/B dimensions.

The check covers the static leading-dimension contract between band eigenvalues and orbital projection weights.

Notes

The test constructs independently valid carriers with incompatible k-point counts and matches the factory’s dimension diagnostic.

Return type:

None

Validate static transformation-contract carriers and their factories.

The cases cover immutable field storage, validity consistency, and the identity and semantic-term rejection rules owned by diffpes.types.

class tests.test_diffpes.test_types.test_contracts.TestTransformationContract[source]

Bases: object

Validate TransformationContract storage.

The carrier must preserve the normalized static semantic contract returned by its public factory.

See:

TransformationContract

test_stores_static_semantics() None[source]

Preserve every declared semantic term without reordering it.

The check verifies the carrier fields against explicitly supplied semantic labels and the declared JAX-purity flag.

Notes

The test constructs one contract through the validated factory and compares its immutable tuples and Boolean flag with the independent input values.

Return type:

None

class tests.test_diffpes.test_types.test_contracts.TestCompositionReport[source]

Bases: object

Validate CompositionReport storage.

The carrier must expose the cumulative semantics and transformation order recorded by its public factory.

See:

CompositionReport

test_stores_composition_state() None[source]

Preserve successful composition state and ordered references.

The check verifies that an error-free report retains its final semantic set and transformation order exactly.

Notes

The test builds a valid report with two transformation references and compares each static field with the independently specified tuples.

Return type:

None

class tests.test_diffpes.test_types.test_contracts.TestMakeTransformationContract[source]

Bases: object

Validate make_transformation_contract().

The factory must reject malformed identities, duplicate terms, and contradictory preservation and destruction declarations.

See:

make_transformation_contract()

test_rejects_invalid_contracts(kwargs: dict[str, object], message: str) None[source]

Reject every malformed static contract declaration.

The parameter table covers invalid identities and versions, duplicate terms, and mutually contradictory information-flow declarations.

Notes

The test calls the factory once for each invalid declaration. It matches the diagnostic text and identifies each static branch.

Return type:

None

class tests.test_diffpes.test_types.test_contracts.TestMakeCompositionReport[source]

Bases: object

Validate make_composition_report().

The factory must keep its validity flag equivalent to an empty error set.

See:

make_composition_report()

test_rejects_inconsistent_validity() None[source]

Reject a successful flag paired with composition errors.

The check isolates the factory invariant that valid is true if and only if the error sequence is empty.

Notes

The test supplies one explicit error with valid=True. It matches the consistency diagnostic before report construction.

Return type:

None

Validate density-of-states carriers and their public factories.

The cases cover JIT construction, full-carrier PyTree reconstruction, and the strictly increasing energy-axis contract shared by both factories.

class tests.test_diffpes.test_types.test_dos.TestDensityOfStates[source]

Bases: object

Validate DensityOfStates array storage.

The carrier must retain the shared energy and density axes together with a scalar Fermi-energy reference.

See:

DensityOfStates

test_stores_density_arrays() None[source]

Preserve equal-length energy and total-DOS arrays.

The check verifies 16 energy samples, 16 density values, and a scalar Fermi energy of -1.5 eV.

Notes

The test constructs the carrier through the public factory and checks shapes and the independently specified scalar with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_dos.TestFullDensityOfStates[source]

Bases: object

Validate FullDensityOfStates as a PyTree.

Optional spin and projected fields must remain absent while required array leaves survive JAX reconstruction.

See:

FullDensityOfStates

test_pytree_round_trip() None[source]

Preserve required full-DOS leaves through a PyTree round trip.

The check compares a 50-point total DOS, its integral, and the scalar Fermi energy after JAX flattening and reconstruction.

Notes

The test builds a spin-up-only full carrier, uses JAX tree utilities for the round trip, and compares the restored values with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_dos.TestMakeDensityOfStates(*args, **kwargs) None[source]

Bases: TestCase

Validate make_density_of_states() under JIT.

The factory must construct the same finite carrier in eager and compiled execution and reject non-increasing energy coordinates.

See:

make_density_of_states()

test_rejects_unsorted_energy_axis() None[source]

Reject repeated coordinates on the DOS energy axis.

The check enforces strict monotonicity independently of the density values supplied at those coordinates.

Notes

Supplies two equal energy values and matches the traced validation diagnostic through the shared rejection helper.

Return type:

None

test_constructs_in_both_execution_modes__with_jit() None

Construct equal-shape DOS fields in eager and compiled execution.

The check gates the 32-point output shape and scalar Fermi-energy value in both Chex execution variants.

Notes

The test wraps the public factory with self.variant, supplies finite arrays, and compares the resulting shape and scalar with Chex.

Return type:

None

test_constructs_in_both_execution_modes__without_jit() None

Construct equal-shape DOS fields in eager and compiled execution.

The check gates the 32-point output shape and scalar Fermi-energy value in both Chex execution variants.

Notes

The test wraps the public factory with self.variant, supplies finite arrays, and compares the resulting shape and scalar with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_dos.TestMakeFullDensityOfStates[source]

Bases: object

Validate make_full_density_of_states().

The full factory must enforce the same strict energy ordering as the compact carrier while validating its integrated-DOS field.

See:

make_full_density_of_states()

test_rejects_unsorted_energy_axis() None[source]

Reject repeated coordinates on the full-DOS energy axis.

The check verifies strict monotonicity for a complete spin-up DOS input whose density and integral otherwise have compatible shapes.

Notes

Supplies two repeated energy coordinates and matches the factory’s traced ordering diagnostic through the rejection helper.

Return type:

None

Validate the carrier for the geometry of an ARPES experiment.

The tests cover the static slit field, traced validation, polarization normalization, PyTree reconstruction, and sensitivity of every numerical field.

class tests.test_diffpes.test_types.test_experiment.TestExperimentGeometry[source]

Bases: object

Validate ExperimentGeometry as a JAX PyTree.

The cases cover reconstruction and the exact division between numerical leaves and the static slit selector.

See:

ExperimentGeometry

test_preserves_the_carrier_through_a_tree_round_trip() None[source]

Preserve all fields through a JAX tree round trip.

The restored carrier must retain equal numerical leaves and the same static slit selector.

Notes

The test flattens one geometry with JAX and reconstructs it from the resulting leaves and tree definition.

Return type:

None

test_keeps_only_the_slit_out_of_the_numerical_leaves() None[source]

Keep all 11 numerical fields in the traced partition.

The static slit must not appear among the leaves that JAX transforms.

Notes

The test partitions the carrier with equinox.is_array() and counts the numerical leaves in the dynamic result.

Return type:

None

test_crosses_a_compiled_boundary_as_one_carrier() None[source]

Pass the complete carrier through compiled execution.

The compiled function must read traced energy and polarization fields while it preserves the static slit selection.

Notes

The test compiles a scalar reduction over two numerical fields and compares it with the same closed-form sum.

Return type:

None

class tests.test_diffpes.test_types.test_experiment.TestMakeExperimentGeometry[source]

Bases: object

Validate make_experiment_geometry().

The cases cover every range check under JIT, the polarization gauge, and gradients through all numerical experiment fields.

See:

make_experiment_geometry()

test_normalizes_each_nonzero_complex_polarization() None[source]

Normalize each accepted complex polarization to unit norm.

The norm must equal one within 1e-15 for generic complex vectors.

Notes

Hypothesis supplies six bounded components. The test combines them into three complex values and checks the Hermitian vector norm.

Return type:

None

test_rejects_each_invalid_scalar_under_jit(field: str, value: object, match: str) None[source]

Reject each scalar that violates the traced physical domain.

Eager and compiled execution must report the same field-specific validation failure.

Notes

The test changes one default input and delegates both execution modes to the shared rejection assertion.

Return type:

None

test_rejects_invalid_polarization_under_jit(polarization: Complex[Array, '3']) None[source]

Reject a zero or non-finite polarization under JIT.

The factory must keep both invalid branches finite before it raises the applicable runtime error.

Notes

The shared assertion calls the factory eagerly and through equinox.filter_jit().

Return type:

None

test_rejects_an_unknown_static_slit() None[source]

Reject a slit selector outside the two detector conventions.

The static check must fail before JAX traces numerical validation.

Notes

The test supplies "X" and matches the slit diagnostic in eager and compiled execution.

Return type:

None

test_preserves_sensitivity_of_each_scalar_field() None[source]

Preserve finite and nonzero gradients through every scalar field.

Automatic derivatives must agree with central differences at the smooth registered geometry.

Notes

A weighted scalar loss reads all ten scalar fields. The shared gate checks reverse mode, finite differences, and every gradient entry.

Return type:

None

Validate crystal-geometry carriers and reciprocal-lattice construction.

The cases cover PyTree reconstruction, an analytic cubic reciprocal lattice, and rejection of a left-handed real-space basis.

class tests.test_diffpes.test_types.test_geometry.TestCrystalGeometry[source]

Bases: object

Validate CrystalGeometry as a JAX PyTree.

Numeric leaves and static chemical symbols must survive JAX flattening and reconstruction without changing the crystal description.

See:

CrystalGeometry

test_pytree_round_trip() None[source]

Preserve array leaves and static symbols through a PyTree round trip.

The check compares a 3 Angstrom cubic lattice and one silicon symbol after JAX flattening and reconstruction.

Notes

The test constructs a one-atom geometry, flattens and unflattens it with JAX, then uses Chex for the numerical and static comparisons.

Return type:

None

class tests.test_diffpes.test_types.test_geometry.TestMakeCrystalGeometry[source]

Bases: object

Validate make_crystal_geometry().

The factory must compute the analytic reciprocal basis of a cubic lattice and reject non-right-handed input cells.

See:

make_crystal_geometry()

test_computes_cubic_reciprocal_lattice() None[source]

Match the analytic reciprocal lattice for a cubic cell.

For lattice constant 5 Angstrom, every reciprocal diagonal must equal \(2\pi/5\) inverse Angstrom within atol=1e-10.

Notes

The test constructs the cubic geometry, calculates the closed-form reciprocal matrix independently, and compares both matrices with Chex.

Return type:

None

test_rejects_left_handed_lattice() None[source]

Reject a finite real-space lattice with negative handedness.

The check verifies the determinant-sign convention independently of coordinate and species validation.

Notes

Supplies a diagonal lattice with determinant -1 and matches the factory’s right-handedness diagnostic.

Return type:

None

Validate certificate-difference carriers and their public factory.

The cases cover empty and categorized comparisons plus rejection of malformed immutable category sequences in diffpes.types.inspection.

class tests.test_diffpes.test_types.test_inspection.TestCertificateDiff[source]

Bases: object

Validate CertificateDiff derived properties.

The carrier must distinguish an identical comparison from categorized scientific, numerical, environment, and audit differences.

See:

CertificateDiff

test_summarizes_categorized_differences() None[source]

Report nonempty comparison categories in a stable one-line form.

The check verifies both the identical predicate and the exact scientific and audit category names included in summary.

Notes

The test constructs a difference through the public factory, then evaluates the two derived properties without rerunning any physical model.

Return type:

None

class tests.test_diffpes.test_types.test_inspection.TestMakeCertificateDiff[source]

Bases: object

Validate make_certificate_diff().

The factory must produce an identical empty comparison and reject blank or mutable category entries.

See:

make_certificate_diff()

test_builds_identical_empty_difference() None[source]

Represent an empty comparison as identical certificates.

The check verifies the factory defaults and the corresponding stable human-readable summary.

Notes

The test calls the factory with no categories and compares both public derived properties with their independently expected values.

Return type:

None

test_rejects_blank_category_name() None[source]

Reject a blank field name in any difference category.

The check exercises the immutable category validation contract with an invalid scientific field name.

Notes

Supplies a one-element tuple containing an empty string and matches the factory’s nonempty-field diagnostic.

Return type:

None

Validate k-path metadata storage and mode consistency.

The cases cover immutable plotting metadata and rejection of unsupported KPOINTS mode selectors in diffpes.types.kpath.

class tests.test_diffpes.test_types.test_kpath.TestKPathInfo[source]

Bases: object

Validate KPathInfo field storage.

The carrier must preserve line-mode labels and their integer indices.

See:

KPathInfo

test_stores_line_mode_metadata() None[source]

Preserve line-mode indices, labels, and mode text.

The check verifies the three label positions for a 100-point path and the corresponding static symmetry labels.

Notes

The test constructs the carrier through its validated factory, checks the array shape with Chex, and compares the static metadata exactly.

Return type:

None

class tests.test_diffpes.test_types.test_kpath.TestMakeKPathInfo[source]

Bases: object

Validate make_kpath_info().

The factory must reject mode strings outside the supported parser conventions.

See:

make_kpath_info()

test_rejects_unknown_mode() None[source]

Reject a k-path mode outside the supported static set.

The check isolates the mode selector contract before interpretation of optional arrays for a mode.

Notes

Supplies otherwise valid minimal metadata with mode="unknown" and matches the allowed-mode diagnostic.

Return type:

None

test_rejects_incomplete_line_metadata() None[source]

Reject missing labels, unequal label counts, and zero segments.

The parser carrier requires complete static metadata for line mode.

Notes

The shared helper checks each independent structure error in eager and compiled execution.

Return type:

None

test_validates_each_optional_numeric_field() None[source]

Store finite optional arrays and reject each non-finite array.

The factory must apply its traced finite-value checks to k-points, weights, and the grid shift.

Notes

The test first constructs all optional fields. It then changes one floating field to NaN in each shared rejection check.

Return type:

None

class tests.test_diffpes.test_types.test_kpath.TestKPath[source]

Bases: object

Validate KPath as a JAX PyTree.

The cases cover reconstruction and the division between traced path data and static plotting metadata.

See:

KPath

test_preserves_static_and_traced_fields_in_a_tree_round_trip() None[source]

Preserve path coordinates and plotting metadata after reconstruction.

The tree must expose only the k-points and fixed kz as numerical leaves.

Notes

The test flattens one path and restores it with the same JAX tree definition. Chex compares the complete carriers.

Return type:

None

class tests.test_diffpes.test_types.test_kpath.TestKGrid[source]

Bases: object

Validate KGrid as a JAX PyTree.

The cases cover the static raster shape and optional traced axis values.

See:

KGrid

test_keeps_only_the_mesh_shape_static() None[source]

Keep the raster coordinates and optional values as traced leaves.

The dynamic partition must contain the k-points, kz, and the photon-energy axis.

Notes

The test partitions one two-by-two grid with equinox.is_array() and counts its JAX leaves.

Return type:

None

class tests.test_diffpes.test_types.test_kpath.TestMakeKPath[source]

Bases: object

Validate make_kpath().

The cases cover static metadata checks, compiled finite-value validation, and coordinate sensitivity.

See:

make_kpath()

test_rejects_nonfinite_path_data_under_jit() None[source]

Reject non-finite path data in eager and compiled modes.

Runtime validation must identify either the k-point or fixed kz field in both modes.

Notes

The shared helper sends one invalid k-point path and one invalid kz value through both execution modes.

Return type:

None

test_rejects_invalid_static_metadata() None[source]

Reject unordered indices or indices outside the path.

Static validation must fail before traced coordinate validation.

Notes

The test supplies two descending indices and matches the ordering diagnostic in eager and compiled modes.

Return type:

None

test_rejects_each_other_invalid_static_setting() None[source]

Reject a zero segment size and inconsistent label metadata.

The factory must reject each invalid structure before it validates the traced coordinates.

Notes

The test sends three independent invalid cases through eager and compiled execution with the shared rejection helper.

Return type:

None

test_preserves_gradients_through_all_kpoint_components() None[source]

Preserve finite nonzero gradients through all path coordinates.

Automatic derivatives must agree with central differences for a weighted coordinate reduction.

Notes

The shared gradient gate checks reverse mode and every component of a generic two-point path.

Return type:

None

class tests.test_diffpes.test_types.test_kpath.TestMakeKGrid[source]

Bases: object

Validate make_kgrid().

The cases cover raster consistency, compiled axis validation, and coordinate sensitivity.

See:

make_kgrid()

test_rejects_an_inconsistent_static_mesh_shape() None[source]

Reject a mesh shape whose product differs from the point count.

The static contract must hold before any consumer reshapes the raster.

Notes

The test gives six points and a four-element mesh shape. The shared helper checks eager and compiled rejection.

Return type:

None

test_rejects_each_other_invalid_static_shape() None[source]

Reject a nonpositive dimension and an axis with the wrong length.

The factory must validate both parts of the fixed raster contract.

Notes

The shared helper checks eager and compiled rejection for two independent invalid grid structures.

Return type:

None

test_rejects_invalid_traced_grid_data_under_jit() None[source]

Reject invalid traced grid data in eager and compiled modes.

Checks for the energy axis, k-points, and fixed kz must remain active after JAX compilation.

Notes

The shared helper checks one invalid value in each traced grid field.

Return type:

None

test_preserves_gradients_through_all_grid_components() None[source]

Preserve finite nonzero gradients through all grid coordinates.

Automatic derivatives must agree with central differences for a weighted coordinate reduction.

Notes

The shared gradient gate checks reverse mode and every component of a generic two-by-two raster.

Return type:

None

Validate simulation and polarization parameter carriers and factories.

The cases cover PyTree reconstruction, documented defaults, custom optical geometry, data-derived energy windows, and rejection of invalid parameters.

class tests.test_diffpes.test_types.test_params.TestSimulationParams[source]

Bases: object

Validate SimulationParams as a JAX PyTree.

Differentiable broadening leaves and the static fidelity must survive JAX flattening and reconstruction.

See:

SimulationParams

test_pytree_round_trip() None[source]

Preserve broadening and fidelity fields through reconstruction.

The check compares the 0.04 eV Gaussian width and 25,000-point static fidelity before and after a JAX PyTree round trip.

Notes

The test constructs default parameters, flattens and unflattens them with JAX, and compares traced and static fields independently.

Return type:

None

class tests.test_diffpes.test_types.test_params.TestPolarizationConfig[source]

Bases: object

Validate PolarizationConfig field storage.

The carrier must retain differentiable angles and its static polarization selector together.

See:

PolarizationConfig

test_stores_linear_vertical_geometry() None[source]

Preserve an LVP selector and scalar incidence angles.

The check verifies the static LVP convention and the scalar shapes of the two angular fields used to define the optical geometry.

Notes

The test constructs a 45-degree LVP configuration through the public factory and checks the selector and array dimensions with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_params.TestMakeSimulationParams[source]

Bases: object

Validate make_simulation_params().

The factory must provide the documented ARPES defaults, preserve custom values, and reject nonphysical windows and broadenings.

See:

make_simulation_params()

test_constructs_documented_defaults() None[source]

Construct the documented energy window and broadening defaults.

The check verifies [-3, 1] eV, 25,000 samples, and Gaussian and Lorentzian widths of 0.04 eV and 0.1 eV.

Notes

The test calls the factory without arguments and compares all defining default fields with independent constants using Chex.

Return type:

None

test_preserves_custom_temperature() None[source]

Preserve an explicit 300 K simulation temperature.

The check verifies user values override defaults after conversion to a scalar float64 JAX array.

Notes

The test constructs a custom parameter set and compares the stored temperature with an independent 300 K scalar using Chex.

Return type:

None

test_rejects_nonphysical_parameters() None[source]

Reject negative broadening and a reversed energy window.

The check covers both independent physical validation boundaries of the base simulation-parameter factory.

Notes

The test uses the eager-and-JIT rejection helper with a negative Gaussian width and then with energy_min greater than energy_max.

Return type:

None

class tests.test_diffpes.test_types.test_params.TestMakePolarizationConfig[source]

Bases: object

Validate make_polarization_config().

The factory must supply an unpolarized default and reject selectors outside the supported static convention set.

See:

make_polarization_config()

test_constructs_unpolarized_default() None[source]

Construct an unpolarized configuration with scalar angles.

The check verifies the default selector and scalar angle shapes without assuming a downstream polarization-vector implementation.

Notes

The test calls the factory without arguments and checks the static selector and traced array shapes with Chex.

Return type:

None

test_rejects_unknown_type() None[source]

Reject a polarization selector outside the supported set.

The check isolates the static selector contract from all numerical angle validation.

Notes

Supplies polarization_type="unknown" and matches the factory’s allowed-selector diagnostic.

Return type:

None

class tests.test_diffpes.test_types.test_params.TestMakeExpandedSimulationParams[source]

Bases: object

Validate make_expanded_simulation_params().

The factory must derive its energy window from band extrema and symmetric padding. It must retain differentiable dependence on these inputs.

See:

make_expanded_simulation_params()

test_derives_energy_window_from_bands() None[source]

Expand band extrema by the requested energy padding.

For bands spanning [-2, 3] eV and padding 0.5 eV, the expected simulation window is [-2.5, 3.5] eV.

Notes

Supplies a two-by-two band array, constructs the expanded parameters, and compares both derived bounds with the analytic extrema.

Return type:

None

Validate provenance and information-flow carriers and factories.

The cases cover immutable semantic states, graph-boundary invariants, and validity consistency without invoking the higher-level propagation engine.

class tests.test_diffpes.test_types.test_provenance.TestInformationState[source]

Bases: object

Validate InformationState storage.

The carrier must keep available semantics separate from destroyed information and invalidated claims.

See:

InformationState

test_separates_semantic_categories() None[source]

Preserve active, destroyed, and invalidated semantic categories.

The check compares each immutable category against independently supplied labels for one artifact node.

Notes

The test constructs the state through its public factory and reads every static information-flow field directly from the resulting carrier.

Return type:

None

class tests.test_diffpes.test_types.test_provenance.TestProvenanceGraph[source]

Bases: object

Validate ProvenanceGraph storage.

The carrier must retain deterministic root semantics, propagated states, topological order, and graph identity.

See:

ProvenanceGraph

test_stores_empty_valid_graph() None[source]

Represent a valid external root with no transformation edges.

The check verifies the minimal graph boundary independently of graph propagation behavior owned by diffpes.certify.

Notes

The test builds one root state and an edge-free graph, then compares root, order, state, and checksum fields with their explicit inputs.

Return type:

None

class tests.test_diffpes.test_types.test_provenance.TestProvenanceReport[source]

Bases: object

Validate ProvenanceReport storage.

The carrier must retain graph endpoints and validation status without introducing differentiable leaves.

See:

ProvenanceReport

test_stores_valid_graph_summary() None[source]

Preserve graph roots, terminals, order, and checksum.

The check verifies the complete successful-report boundary for a single-root, single-terminal graph.

Notes

The test constructs a valid report through the public factory and compares its static endpoint fields with independently specified tuples.

Return type:

None

class tests.test_diffpes.test_types.test_provenance.TestMakeInformationState[source]

Bases: object

Validate make_information_state().

The factory must reject blank node identities and duplicate semantic labels before constructing an immutable state.

See:

make_information_state()

test_rejects_invalid_state(node_id: str, active_semantics: tuple[str, ...], message: str) None[source]

Reject an invalid node identity or duplicated semantic label.

The parameter table covers the two independent validation boundaries of the semantic-state factory.

Notes

The test calls the factory for each malformed static input and matches the diagnostic emitted by the corresponding validation branch.

Return type:

None

class tests.test_diffpes.test_types.test_provenance.TestMakeProvenanceGraph[source]

Bases: object

Validate make_provenance_graph().

The factory must require exactly one initial-semantic entry for every external root and unique propagated state identities.

See:

make_provenance_graph()

test_rejects_incomplete_root_semantics() None[source]

Reject a graph whose initial semantics omit an external root.

The check isolates the root-coverage invariant at the carrier factory rather than relying on the higher-level graph builder.

Notes

Supplies one external input and no initial-semantic pairs, then matches the explicit root-coverage diagnostic.

Return type:

None

class tests.test_diffpes.test_types.test_provenance.TestMakeProvenanceReport[source]

Bases: object

Validate make_provenance_report().

The factory must keep the report validity flag equivalent to an empty validation-error sequence.

See:

make_provenance_report()

test_rejects_inconsistent_validity() None[source]

Reject a successful provenance report containing errors.

The check verifies the Boolean consistency invariant independently of graph construction and semantic propagation.

Notes

Supplies valid=True with one error and matches the consistency diagnostic raised before construction.

Return type:

None

Validate orbital-basis and Slater-parameter carriers and factories.

The cases cover static PyTree metadata, differentiable radial parameters, default labels and coefficients, and quantum-number and shape validation.

class tests.test_diffpes.test_types.test_radial_params.TestOrbitalBasis[source]

Bases: object

Validate OrbitalBasis as static PyTree data.

Quantum numbers and labels must survive JAX reconstruction without becoming differentiable leaves.

See:

OrbitalBasis

test_pytree_round_trip() None[source]

Preserve three orbital labels and quantum-number tuples.

The check compares s, p, and d metadata before and after a JAX PyTree round trip.

Notes

The test constructs the basis with explicit tuples, flattens and unflattens it, and compares every static field exactly.

Return type:

None

class tests.test_diffpes.test_types.test_radial_params.TestSlaterParams[source]

Bases: object

Validate SlaterParams gradient behavior.

Slater exponents and coefficients must remain differentiable JAX leaves while their orbital basis remains static structure.

See:

SlaterParams

test_zeta_gradient() None[source]

Differentiate a quadratic loss through the Slater exponent.

At exponent 2 inverse Angstrom, the derivative of \(\zeta^2\) must equal 4 within the default Chex numerical tolerance.

Notes

The test constructs one radial parameter carrier, differentiates an independent quadratic loss with JAX, and compares its zeta gradient with 4.

Return type:

None

class tests.test_diffpes.test_types.test_radial_params.TestMakeOrbitalBasis[source]

Bases: object

Validate make_orbital_basis().

The factory must generate stable labels and reject inconsistent tuple lengths or quantum numbers outside their physical ranges.

See:

make_orbital_basis()

test_generates_default_labels() None[source]

Generate zero-indexed labels for unlabeled orbitals.

The check verifies the independent naming convention orb_0 and orb_1 for a two-orbital basis.

Notes

The test constructs a valid two-orbital basis without labels and compares the immutable generated tuple exactly.

Return type:

None

test_rejects_mismatched_lengths() None[source]

Reject unequal quantum-number and label tuple lengths.

The check covers both the three required quantum-number axes and the optional label axis.

Notes

The test calls the factory once with mismatched quantum numbers and once with an extra label, matching the shared static diagnostic.

Return type:

None

test_rejects_invalid_quantum_numbers() None[source]

Reject principal quantum numbers below one.

The check isolates the lower bound on n from the angular and magnetic quantum-number constraints.

Notes

Supplies a length-consistent one-orbital tuple with n=0 and matches the factory’s principal-quantum-number diagnostic.

Return type:

None

class tests.test_diffpes.test_types.test_radial_params.TestMakeSlaterParams[source]

Bases: object

Validate make_slater_params().

The factory must provide unit default coefficients, normalize dtype, and reject incompatible or nonpositive radial parameters.

See:

make_slater_params()

test_supplies_unit_coefficients() None[source]

Create one unit coefficient per orbital when omitted.

The check expects a 2 x 1 float64 matrix of ones for two Slater exponents.

Notes

The test constructs a two-orbital basis and radial carrier without coefficients, then compares shape, dtype, and values with Chex.

Return type:

None

test_casts_explicit_coefficients_to_float64() None[source]

Promote explicit float32 coefficients to float64.

The check verifies the project-wide precision policy for a two-orbital, two-term Slater expansion.

Notes

Supplies a float32 coefficient matrix and checks its stored shape and dtype after factory normalization.

Return type:

None

test_rejects_invalid_radial_arrays() None[source]

Reject nonpositive exponents and coefficient-axis mismatches.

The check covers the physical lower bound on zeta and the static first-axis agreement with the orbital basis.

Notes

The test uses the eager-and-JIT rejection helper with zero exponent and then a two-row coefficient matrix for a one-orbital basis.

Return type:

None

Validate self-energy configuration carriers and factory modes.

The cases cover differentiable leaf reconstruction, default and polynomial configuration, and the static and traced validation rules for tabulated data.

class tests.test_diffpes.test_types.test_self_energy.TestSelfEnergyConfig[source]

Bases: object

Validate SelfEnergyConfig as a JAX PyTree.

The static mode and differentiable coefficient leaves must survive JAX flattening and reconstruction together.

See:

SelfEnergyConfig

test_pytree_round_trip() None[source]

Preserve self-energy mode and coefficients through reconstruction.

The check compares a constant 0.2 eV broadening before and after a JAX PyTree round trip.

Notes

The test constructs the carrier through its factory, flattens and unflattens it with JAX, then compares the static and array fields independently.

Return type:

None

class tests.test_diffpes.test_types.test_self_energy.TestMakeSelfEnergyConfig[source]

Bases: object

Validate make_self_energy_config().

The factory must construct supported constant and polynomial modes while rejecting invalid selectors and malformed tabulated coordinates.

See:

make_self_energy_config()

test_constructs_constant_default() None[source]

Construct the documented constant 0.1 eV default broadening.

The check verifies the static mode, one-element coefficient shape, and scalar value to pytest.approx precision.

Notes

The test calls the factory without arguments and compares every field defining the default constant configuration.

Return type:

None

test_constructs_polynomial_mode() None[source]

Preserve two explicit polynomial coefficients.

The check verifies the static polynomial selector and coefficients [0.01, 0.1] used for energy-dependent broadening.

Notes

The test constructs the polynomial configuration with a JAX array and compares the stored mode and coefficients directly.

Return type:

None

test_rejects_missing_tabulated_nodes() None[source]

Reject tabulated broadening without interpolation nodes.

The check enforces the required coordinate set for a tabulated self-energy configuration.

Notes

The test selects tabulated mode without energy_nodes and matches the static factory diagnostic.

Return type:

None

test_rejects_invalid_mode() None[source]

Reject a self-energy mode outside the supported static set.

The check isolates selector validation from all numerical parameter checks.

Notes

Supplies mode="invalid" and matches the factory’s allowed-mode diagnostic.

Return type:

None

test_rejects_unsorted_or_mismatched_nodes() None[source]

Reject repeated nodes and unequal node and coefficient lengths.

The check covers both tabulated-axis invariants with otherwise finite numerical inputs.

Notes

The test uses the shared eager-and-JIT rejection helper for repeated nodes and then for a three-node, two-coefficient length mismatch.

Return type:

None

Validate tight-binding and diagonalized-band carriers and factories.

The cases cover PyTree reconstruction, differentiable hopping parameters, eigensystem validation, connectivity bounds, and two analytic model presets.

class tests.test_diffpes.test_types.test_tb_model.TestDiagonalizedBands[source]

Bases: object

Validate DiagonalizedBands as a JAX PyTree.

Real eigenvalues and complex eigenvectors must survive JAX reconstruction without changing their k-point and orbital axes.

See:

DiagonalizedBands

test_pytree_round_trip() None[source]

Preserve a two-point eigensystem through JAX reconstruction.

The check compares a 2 x 2 energy matrix and its complex identity eigenvectors after a PyTree round trip.

Notes

The test constructs the carrier through its factory, flattens and unflattens it with JAX, and compares both numerical leaves with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_tb_model.TestTBModel[source]

Bases: object

Validate TBModel gradient behavior.

Hopping amplitudes must remain differentiable leaves while connectivity and the orbital basis remain static model structure.

See:

TBModel

test_hopping_gradient() None[source]

Differentiate a quadratic loss through hopping amplitudes.

At hopping value 1 eV, the derivative of \(t^2\) must equal 2 within the default Chex numerical tolerance.

Notes

The test constructs a one-hop model, differentiates an independently defined quadratic loss with JAX, and compares the hopping leaf with 2.

Return type:

None

class tests.test_diffpes.test_types.test_tb_model.TestMakeDiagonalizedBands[source]

Bases: object

Validate make_diagonalized_bands().

The factory must preserve compatible eigensystem dimensions and reject non-finite eigenvectors or mismatched k-point axes.

See:

make_diagonalized_bands()

test_constructs_expected_shapes() None[source]

Construct a five-point, three-band, four-orbital eigensystem.

The check gates the exact eigenvalue and eigenvector dimensions after dtype normalization by the factory.

Notes

Supplies finite zero energies and unit complex vectors, then checks both carrier shapes with Chex.

Return type:

None

test_rejects_invalid_eigensystems() None[source]

Reject non-finite vectors and inconsistent k-point dimensions.

The check covers the numerical finiteness guard and the static leading dimension contract between eigenvalues and eigenvectors.

Notes

The test uses the eager-and-JIT rejection helper first with a NaN vector and then with unequal one- and two-point eigensystem arrays.

Return type:

None

class tests.test_diffpes.test_types.test_tb_model.TestMakeTBModel[source]

Bases: object

Validate make_tb_model().

The factory must preserve hopping arrays and reject connectivity that references an orbital outside the declared basis.

See:

make_tb_model()

test_constructs_hopping_array() None[source]

Store two nearest-neighbor hopping amplitudes.

The check verifies the one-dimensional hopping shape for forward and backward translations of a single orbital.

Notes

The test constructs a validated model with two static connectivity entries and checks the differentiable hopping leaf shape with Chex.

Return type:

None

test_rejects_out_of_range_orbital_index() None[source]

Reject connectivity referencing an absent second orbital.

The check isolates the static orbital-index bound for a model declaring exactly one orbital.

Notes

Supplies connectivity ending at index one and matches the factory’s allowed-index diagnostic.

Return type:

None

class tests.test_diffpes.test_types.test_tb_model.TestMake1dChainModel[source]

Bases: object

Validate make_1d_chain_model().

The preset must construct one orbital with two translated nearest-neighbor hopping entries and preserve the supplied amplitude.

See:

make_1d_chain_model()

test_constructs_chain_connectivity() None[source]

Construct the two-hop one-orbital chain preset.

The check verifies two amplitudes of -1.5 eV and the declared single-orbital model size.

Notes

The test calls the convenience factory with an explicit hopping value and compares the carrier’s static size and numerical hopping leaf.

Return type:

None

class tests.test_diffpes.test_types.test_tb_model.TestMakeGrapheneModel[source]

Bases: object

Validate make_graphene_model().

The preset must construct the two-sublattice honeycomb model with the expected number of nearest-neighbor hopping entries.

See:

make_graphene_model()

test_constructs_two_orbital_model() None[source]

Construct the two-orbital graphene preset.

The check verifies the A/B orbital count and that every generated hopping amplitude equals the supplied -2.7 eV value.

Notes

The test calls the convenience factory, checks its static orbital count, and compares all numerical hopping leaves with an independent constant.

Return type:

None

Validate scalar and spin-orbit volumetric carriers and factories.

The cases cover PyTree reconstruction, default atom counts, and consistency between static grid metadata and scalar or vector-valued volumetric arrays.

class tests.test_diffpes.test_types.test_volumetric.TestVolumetricData[source]

Bases: object

Validate VolumetricData as a JAX PyTree.

Charge-density leaves and static grid and species metadata must survive flattening and reconstruction together.

See:

VolumetricData

test_pytree_round_trip() None[source]

Preserve charge values and static metadata through reconstruction.

The check compares a 4 x 4 x 4 unit charge grid, its grid shape, and two species labels after a JAX PyTree round trip.

Notes

The test constructs the scalar carrier through its factory, uses JAX tree utilities for reconstruction, and compares numerical and static fields.

Return type:

None

class tests.test_diffpes.test_types.test_volumetric.TestSOCVolumetricData[source]

Bases: object

Validate SOCVolumetricData as a JAX PyTree.

Scalar and vector magnetization leaves must remain associated with their common spin-orbit grid through JAX transformations.

See:

SOCVolumetricData

test_pytree_round_trip() None[source]

Preserve charge and magnetization grids through reconstruction.

The check uses a 2 x 2 x 2 scalar grid and a final vector axis of length three for the spin-orbit magnetization components.

Notes

The test constructs the SOC carrier, applies a JAX flatten and unflatten round trip, and compares all numerical grid leaves with Chex.

Return type:

None

class tests.test_diffpes.test_types.test_volumetric.TestMakeVolumetricData[source]

Bases: object

Validate make_volumetric_data().

The scalar factory must supply an empty integer atom-count array and reject charge grids inconsistent with static shape metadata.

See:

make_volumetric_data()

test_supplies_empty_atom_counts() None[source]

Create a zero-length int32 atom-count array when omitted.

The check verifies both dtype and shape of the stable array sentinel used instead of None.

Notes

The test constructs a one-species volume without atom_counts and uses Chex to compare the resulting array shape and dtype.

Return type:

None

test_rejects_grid_shape_mismatch() None[source]

Reject charge data inconsistent with the declared grid shape.

The check verifies that a 2 x 2 x 2 charge array cannot have a 1 x 1 x 1 grid label.

Notes

Supplies otherwise compatible geometry and matches the factory’s static charge-shape diagnostic.

Return type:

None

class tests.test_diffpes.test_types.test_volumetric.TestMakeSOCVolumetricData[source]

Bases: object

Validate make_soc_volumetric_data().

The SOC factory must provide the same atom-count sentinel. It must require vector magnetization dimensions that match the static grid.

See:

make_soc_volumetric_data()

test_supplies_empty_atom_counts() None[source]

Create a zero-length int32 atom-count array when omitted.

The check verifies the stable array sentinel for a minimal SOC volume with all four required grid blocks.

Notes

The test constructs a one-point SOC volume without atom_counts and checks the resulting array dtype and shape.

Return type:

None

test_rejects_vector_grid_shape_mismatch() None[source]

Reject vector magnetization with incompatible spatial dimensions.

The check verifies all three spatial dimensions against the declared grid independently of the final three-component axis.

Notes

Supplies a vector grid with a doubled first dimension and matches the factory’s static spatial-shape diagnostic.

Return type:

None