Module: openfermion.testing

Modules

circuit_validation module: Tools to assist in circuit/primitive design

random module

testing_utils module: Functions useful for tests.

wrapped module

Classes

class EqualsTester: Tests equality against user-provided disjoint equivalence groups.

Functions

assert_equivalent_repr(...): Checks that eval(repr(v)) == v.

assert_implements_consistent_protocols(...): Checks that a value is internally consistent and has a good repr.

haar_random_vector(...): Generate an n dimensional Haar randomd vector.

module_importable(...): Without importing it, returns whether python module is importable.

random_antisymmetric_matrix(...): Generate a random n x n antisymmetric matrix.

random_diagonal_coulomb_hamiltonian(...): Generate a random instance of DiagonalCoulombHamiltonian.

random_hermitian_matrix(...): Generate a random n x n Hermitian matrix.

random_interaction_operator(...): Generate a random instance of InteractionOperator.

random_interaction_operator_term(...): Generates a random interaction operator with non-zero coefficients only on terms corresponding to the given number of unique orbitals.

random_quadratic_hamiltonian(...): Generate a random instance of QuadraticHamiltonian.

random_qubit_operator(...)

random_unitary_matrix(...): Obtain a random n x n unitary matrix.

validate_trotterized_evolution(...): Checks whether a circuit implements Trotterized evolution