quantumlib / OpenFermion

The electronic structure package for quantum computers.
Apache License 2.0
1.52k stars 376 forks source link

Couldn't find OpenFermion.Hamiltonians Pkg #698

Closed basernapairs closed 3 years ago

basernapairs commented 3 years ago

Hii i want try this ex. code, but still error when after adding OpenFermion pkg, so where Hamiltonians ?

image

image

ncrubin commented 3 years ago

Hi @basernapairs , I believe this problem is related to where PyCall is looking for our python packages. PyCall defaults to a python build that comes in Conda.jl. Following the docs on PyCall I was able to set up a new environment, install openfermion, point my PyCall build to that envs python, and then successfully import OpenFermion.

I used the following after making a new env with a fresh OpenFermion build.

julia> ENV["PYTHON"]="<path to your python3.x"
pkg> add PyCall  # or Pkg.build("PyCall") if you have it already

Then close your julia console. Reopen and try importing OpenFermion. I was able to see the modules from inside the Julia console so I assume they are usable.