pdft.coherence.certify_flat_modulus#
- pdft.coherence.certify_flat_modulus(basis, frozen_indices=None, *, atol=1e-08)[source]#
Certify that training cannot raise mu above 1.
Two conditions, both necessary. The basis must be flat-modulus now, and every tensor left trainable must be diagonal — then by the proposition in the module docstring, mu == 1 for every value those parameters can take.
frozen_indicesis the same argumenttrain_basis_batchedaccepts, so:cert = certify_flat_modulus(basis, frozen_indices=frozen) if not cert: raise ValueError(cert.reason) result = train_basis_batched(basis, frozen_indices=frozen, ...)
Frozen non-diagonal gates are fine: a fixed Hadamard is what the proposition assumes. It is training them that voids it.
The proposition’s other hypothesis, one Hadamard per wire, is not checked. Every basis in the package satisfies it; for a circuit of your own with two Hadamards on a wire the certificate can hold where
sampled_flat_modulusshows it does not.- Parameters:
- Return type: