Testing¶
-
test_canonize.test_mixed_canonize()[source]¶ Test if left_canonize and right_canonize work as expected when used together
-
test_mps.new_random_state(d, n)[source]¶ Generate a random (normalized) state in dense representation for a system of n d-dimensional sites.
- Parameters
n (int) -- Number of degrees of freedom
d (int) -- Local dimension of the single degree of freedom
- Returns
random_state -- Normalized dense random state of n degrees of freedom of dimension d
- Return type
numpy array shape (d^n)
-
test_mps.test_approx_error()[source]¶ For a sufficiently high chi, the approximation error should go to 0
-
test_mps.test_ghz_state()[source]¶ Test with the ghz state, for which a chi=2 dimension should suffice for full precision
-
test_mps.test_random_states()[source]¶ Generate random states of n qubits, convert them to MPS and back to dense, and see if the results match with the originals.
-
test_mps.test_with_quimb_mps()[source]¶ Convert a random state with the manual algorithm and with quimb. Check if they are compatible with each other