Open PabloAMC opened 3 years ago
I take it that by norm you mean spectral norm / largest eigenvalue? Bounding this well is hard. The bounds I know of is the Frobenius norm that you mentioned, and a quick wikipedia scan also claims the spectral norm is bounded by sqrt(||A||1 ||A||{\infty}), where ||A||1 and ||A||{\infty} are the largest (absolute value) row sum and largest (absolute value) column sum respectively. Doing anything better than this might require some significant research on your Hamiltonian in question.
Thanks @obriente for the answer. Right now I am even more confused than yesterday because executing
from openfermion.chem import geometry_from_pubchem, MolecularData
import numpy as np
from openfermionpyscf import run_pyscf
molecule_geometry = geometry_from_pubchem('water')
molecule_data = MolecularData(molecule_geometry, basis = "sto-3g" multiplicity = 1)
molecule_pyscf = run_pyscf(molecule_data,run_scf=True, run_mp2=False, run_fci=False)
molecular_hamiltonian = molecule_data.get_molecular_hamiltonian()
fermion_operator = openfermion.get_fermion_operator(molecular_hamiltonian)
JW_op = openfermion.transforms.jordan_wigner(fermion_operator)
sparse_mat = openfermion.get_sparse_operator(JW_op)
max_eig, _ = scipy.sparse.linalg.eigsh(sparse_mat, k=1, which="LM")
d = JW_op.terms
del d[()]
l = abs(np.array(list(d.values())))
lambd = sum(l)
print('<i> ||H||/lambda', -max_eig/self.lambd)
prints
<i> ||H||/lambda [1.0423128]
and I must be doing something wrong then because supposedly ||H||/lambda < 1 (as can be seen from the definition of lambda in my first comment and the fact that H_j are unitary). This effect is even more pronounced for HF, returning [1.26049284]
. So I think the issue is I should not do
del d[()]
Not sure that I follow why ||H||/lambda << 1 is necessary here? Note that the 1 norm / infinity norm I mentioned in the above definition are defined w.r.t. the matrix columns in the 2^Nx2^N matrix representation of the operator, while summing abs(d.values) will give you this 'induced one-norm', which is like the 1-norm in a vector space defined on some basis vectors that are not norm-1 in the original space. So the two aren't equivalent.
Sorry, there was a typo: I did not mean <<
but only <
. As for the proof of why ||H||<lambda:
||H|| = || sum w_j H_j || <= sum |w_j| ||H_j|| = sum (w_j * 1) = lambda
In eq 36 from https://journals.aps.org/prx/pdf/10.1103/PhysRevX.8.041015 the norm of the Hamiltonian is used. In fact, this Hamiltonian norm is used also in other articles that do not use plane waves, such as https://quantum-journal.org/papers/q-2019-12-02-208/pdf/ implicitly assumed in the O(1) appearing in the definition of M (page 9). I have seen that Openfermion has prepared a way to compute the Hamiltonian norm for a DiagonalCoulombHamiltonian, as in https://quantumai.google/openfermion/tutorials/circuits_2_diagonal_coulomb_trotter, but not in the case we are in a different (non-diagonal) basis. The issue is that to make this useful I need such upper bound to be smaller than $\lambda = \sum_j w_j$ for $H = \sum_j w_j H_j$, with $H_j$ unitary and $w_j$ positive. $\lambda$ would be one such upper bound to the norm, but we need something smaller due to the eq 36 mentioned above. Also, it seems that the estimated ground state energy would be close to $||H||$ but all methods give upper bounds to the minimum energy, which is negative, so only lower bounds to the norm of the Hamiltonian. A colleague suggested using the Frobenius norm of the sparse matrix as in
but it is a much worse upper bound than $\lambda$, so not useful. Finally, I have asked in pyscf and psi4 communities (http://forum.psicode.org/t/finding-a-lower-bound-for-the-ground-state-energy/2116) to see how to bound it, but without luck. Any ideas of how to find an upper bound to ||H||? Thanks a lot in advance!