We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code raises an error:
import numpy as np import openfermion as of hermitian_part = np.array( [[0.0, 1.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 0.0]], dtype=complex ) antisymmetric_part = np.array( [[0.0, 1.0j, 0.0], [-1.0j, 0.0, 1.0j], [0.0, -1.0j, 0.0]], dtype=complex ) hamiltonian_quad = of.QuadraticHamiltonian(hermitian_part, antisymmetric_part) hamiltonian = of.get_fermion_operator(hamiltonian_quad) hamiltonian_jw = of.get_sparse_operator(of.jordan_wigner(hamiltonian)) orbital_energies, transformation_matrix, constant = hamiltonian_quad.diagonalizing_bogoliubov_transform() occupied_orbitals = (1,) eig = np.sum(orbital_energies[list(occupied_orbitals)]) + constant circuit = of.prepare_gaussian_state( cirq.LineQubit.range(3), hamiltonian_quad, occupied_orbitals=occupied_orbitals) state = cirq.final_state_vector(circuit, dtype=np.complex128) np.testing.assert_allclose(hamiltonian_jw @ state, eig * state, atol=1e-8)
This is due to an incorrect assumption in the QuadraticHamiltonian code regarding the format of the Schur decomposition.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The following code raises an error:
This is due to an incorrect assumption in the QuadraticHamiltonian code regarding the format of the Schur decomposition.
The text was updated successfully, but these errors were encountered: