Permalink
Browse files

Lower numpy requirement (#478)

* omit numpy.block

* decrease numpy requirement
  • Loading branch information...
kevinsung authored and babbush committed Oct 12, 2018
1 parent e64c17a commit 03cf7eedc9ba0ca96531eb4894955789760c03dc
Showing with 7 additions and 6 deletions.
  1. +1 −1 requirements.txt
  2. +6 −5 src/openfermion/ops/_quadratic_hamiltonian.py
@@ -1,4 +1,4 @@
numpy>=1.13.0
numpy>=1.11.0
scipy>=1.1.0
h5py>=2.8
future
@@ -302,11 +302,12 @@ def index_map(i):
orbital_energies = numpy.concatenate(
(up_orbital_energies, down_orbital_energies))
diagonalizing_unitary_T = numpy.block([
[up_diagonalizing_unitary_T,
numpy.zeros((n_modes//2, n_modes//2))],
[numpy.zeros((n_modes//2, n_modes//2)),
down_diagonalizing_unitary_T]])
diagonalizing_unitary_T = numpy.zeros(
(n_modes, n_modes), dtype=complex)
diagonalizing_unitary_T[
:n_modes//2, :n_modes//2] = up_diagonalizing_unitary_T
diagonalizing_unitary_T[
n_modes//2:, n_modes//2:] = down_diagonalizing_unitary_T
else:
orbital_energies, diagonalizing_unitary_T = numpy.linalg.eigh(
matrix)

0 comments on commit 03cf7ee

Please sign in to comment.