get_change_of_basis_from_eigvecs

forest.benchmarking.robust_phase_estimation.get_change_of_basis_from_eigvecs(eigenvectors: Sequence[numpy.ndarray]) → numpy.ndarray

Generates a unitary matrix that sends each computational basis state to the corresponding eigenvector.

Parameters:eigenvectors – a sequence of dim-many length-dim eigenvectors. In the context of an RPE experiment, these should be eigenvectors of the rotation. For convenience, the function bloch_rotation_to_eigenvectors() will provide the appropriate list of eigenvectors for a rotation about a particular axis in the 1q Bloch sphere. Note that RPE experiment follows the convention of the right-hand rule. E.g. for a 1q rotation lets say eigenvectors {e1, e2} have eigenvalues with phase {p1, p2}. If the relative phase {p1-p2} is positive, then the rotation happens about e1 in the counter-clockwise direction for a clock facing the e1 direction.
Returns:a matrix for the change of basis transformation which maps computational basis states to the given eigenvectors. Necessary for generate_rpe_experiments called on a rotation with the given eigenvectors.