pdft.coherence.sampled_flat_modulus

pdft.coherence.sampled_flat_modulus#

pdft.coherence.sampled_flat_modulus(basis, frozen_indices=None, *, trials=8, atol=1e-08, seed=0)[source]#

Measure the guarantee over drawn values of the tensors left trainable.

Each trial replaces every tensor not in frozen_indices with a random point of its manifold and measures the dense operator. The check holds when every draw is flat-modulus, which is what distinguishes a basis that happens to be incoherent from a training configuration that cannot leave the complex Hadamard set. certify_flat_modulus proves the same thing from the circuit’s structure; this measures it, and says how far a configuration without the guarantee drifts.

Returns the verdict, the worst deviation and the worst mu seen. A draw is judged as is_flat_modulus judges a basis, with the same atol.

Parameters:
Return type:

dict