Giter Club home page Giter Club logo

Comments (18)

babbush avatar babbush commented on August 18, 2024

Are you able to run the scripts "generate_data.py" and "plotter.py" in the examples folder?

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

The code from the jupyter example was running fine. But, when I changed the inputs then I got an error saying that .hdf5 file doesn't exist.
For generate_data.py and generate_diatomic.py I am getting an error (Object 'cisd_one_rmd' doesn't exist)

from fermilib-plugin-psi4.

babbush avatar babbush commented on August 18, 2024

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

I updated everything and now I am able to run generate_diatomic.py but for generate_data.py I am getting an error:
Unable to open file (Unable to open file: name = '/home/kanav/anaconda3/lib/python3.5/site-packages/fermilib/data/h3_sto-3g_doublet_ring_0.7414.hdf5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)
Also, when I made changes in the generate_diatomic.py for running it for H2O, then I got an error:

MissingCalculationError: Missing SCF in /home/kanav/anaconda3/lib/python3.5/site-packages/fermilib/data/H2-O1_sto-3g_singlet_H2O, run before loading integrals.
All, I did was add another geometry for H2O and run it with the same configuration.

from fermilib-plugin-psi4.

babbush avatar babbush commented on August 18, 2024

Hi Kanav,

I just downloaded FermiLib, psi4 and the FermiLib plugin on my girlfriend's Mac (fresh install) and everything is working fine. Are you using linux or mac? At least on Mac, I am not able to replicate this error. I can try on linux when I get back to my office on Tuesday. I do see something strange though where the CCSD calculation on this same file (H3_sto-3g_doublet_ring_0.7414) takes a super long time. This is absolutely due to psi4 (and isn't an error) but it is unfortunate that it is slowing down one of our examples. @jarrodmcc do you see this as well? Any idea what is happening?

Here's a question: did you perhaps install FermiLib or the plugin using
sudo python -m pip install -e .
instead of
python -m pip install -e .

It is possible that FermiLib does not have the ability to write to the data folder if you used sudo. But I doubt this is the error. By the way, are you using develop install (as I showed above) or using the generic pip install? Perhaps you should try the develop install.

Can you show me exactly what lines you changed in generate_diatomic.py in order to see this error with H2O?

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

Hi Ryan,
I am using linux and I used sudo pip install fermilib for fermilib and later upgraded using sudo pip install fermilib --upgrade, and similarly for psi4 and fermilibpluginpsi4.
And following is the code I used for H2O
description = "H2O"
geometry = [('O', (0., 0., 0.)), ('H', (0.757, 0.586, 0.)), ('H', (-0.757, 0.586, 0.))]
molecule = MolecularData(geometry, basis, multiplicity, charge, description)
molecule = run_psi4(molecule, run_scf=run_scf, run_mp2=run_mp2, run_cisd=run_cisd, run_ccsd=run_ccsd, run_fci=run_fci, verbose=verbose, tolerate_error=tolerate_error)
print(molecule.filename)
print(molecule.get_molecular_hamiltonian())
molecule.save()

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

Also, I think it might not be about the write permission because, I can see the H2-O1_sto-3g_singlet_H2O.out file generated by psi4 but H2-O1_sto-3g_singlet_H2O.hdf5 file is not there and same is the case with H3_doublet_ring_0.7414, .out file is there but not the .hdf5 file. And I spent lot of time going through the code in the jupyter notebook, and it was always some error in the run_psi4.py
One problem I couldn't figure out was because it always gave me an error while loading the information of the molecule and no error during saving. But, it seems to me that it is not saving the .hdf5 file properly.

Update: I just found H2-O1_sto-3g_singlet_H2O.hdf5 file and now the error is :
.MissingCalculationError: Missing SCF in /home/kanav/anaconda3/lib/python3.5/site-packages/fermilib/data/H2_sto-3g_singlet_ring_0.7414, run before loading integrals.

from fermilib-plugin-psi4.

babbush avatar babbush commented on August 18, 2024

Hi Kanav,

When I run your code on my machine it works just fine. Although I would comment that you should not write "H2O" in the description since the elemental composition is already recorded in the name. Usually the "description" is something custom you put in to specify something about the geometry. But that is not your problem.

There is clearly a problem with how the HDF5 save is working for you. When you say you "found" the file, where was it? Can you please try the develop install? Again, clone a fresh copy of the fermilib repo, change directories to it and type
python -m pip install -e .
Do the same for the plugin. I kind of doubt this will fix your issue but there is a chance. More likely, none of us checked the code on linux since we mostly use mac.

@thomashaener and @damiansteiger I know you two use linux. Are you able to replicate Kanav's error? Try running the following (just following Kanav's example):

from fermilib.utils import MolecularData
from fermilibpluginpsi4 import run_psi4

basis = 'sto-3g'
multiplicity = 1
geometry = [('O', (0., 0., 0.)), ('H', (0.757, 0.586, 0.)), ('H', (-0.757,
  0.586, 0.))]

molecule = MolecularData(geometry, basis, multiplicity)
molecule = run_psi4(molecule, run_scf=1)

print(molecule.filename)
print(molecule.get_molecular_hamiltonian())

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

Hi Ryan,
I found the file in the data repository.
And, I just noticed that after reinstalling fermilib, none of the tests (including _hydrogen integration.py) are working and are giving me same error run SCF first.
I think I am just going to reinstall everything one more time as you suggested. Also, Thank you for your help :)

from fermilib-plugin-psi4.

thomashaener avatar thomashaener commented on August 18, 2024

@babbush I think I'm the only one using linux, but I don't have psi4 installed

from fermilib-plugin-psi4.

damiansteiger avatar damiansteiger commented on August 18, 2024

Hi Kanav,

I currently don't have psi4 installed so I cannot test it myself, but my guess is that the version of the plugin is not up-to-date:

Did you install it via

sudo pip install fermilibpluginpsi4 --upgrade

This will install the first version uploaded to pypi and some data format has changed since them. I will create new release today to solve this problem.

For you: Either wait a day or install it by downloading the version from github and in the top folder

python -m pip install .

or for a development install (everytime you update this folder, your installed version will also change as it is only a link to this folder):

python -m pip install -e .

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

Thank you Damian and Thomas!
I am actually trying to get all my condas straight. Apparently, psi4 installs its own conda, and after installing psi4 sometimes python commands refer to the path of the conda of the psi4 (for example, pip is present in all the condas and in the \usr\bin directory and all the directories are included in the path, and from what I noticed, it seems to arbitrarily choose the directories when you just say pip install and not include the full path.). And it has been confusing last two days for me, cause it installed fermilib in the psi4 conda and then when I tried it again it installed it in the Anaconda version.
So, hopefully when I get everything straightened out fermilibplugin and fermilib would work just fine, because it did work fine for Ryan.
I will report back in sometime if I get it to work.

from fermilib-plugin-psi4.

babbush avatar babbush commented on August 18, 2024

Hi Kanav,

I am familiar with this issue you are facing, it caused me a lot of trouble as well. I think that the founders need to discuss this ( @damiansteiger @thomashaener @jarrodmcc ) but since this is such a common problem I think we need to somehow give some instructions about how we install psi4. Here is what I do and it seems to work well on both Linux and Mac:

  1. Install anaconda python as your main python.

  2. Add the psi4 channel to your normal anaconda install with:
    conda config --add channels http://conda.anaconda.org/psi4

  3. Install psi4 with
    python -m conda install psi4

  4. Install pip with
    python -m conda install pip

  5. Clone ProjectQ from git.

  6. Go to ProjectQ folder and develop install ProjectQ with
    python -m pip install -e .

  7. Clone FermiLib and Psi4 plugins from git.

  8. Go to both FermiLib directories and develop install with
    python -m pip install -e .

Let me know if you have problems following these instructions. I would suggest you first delete other versions of pythons and remove unnecessary garbage from your bash_profile or bash_rc before attempting.

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

Thanks Ryan!
That worked perfectly, and fermilibpluginpsi4 works too.
But, there are few changes I observed. Earlier the output was displayed on the ipython console in the spyder but it seems like the output from the psi4 module is getting displayed in the terminal. But since the out files are stored in the same location, when I refer to the file it works out.
Also, in the output I did some error message that I wasn't sure where it was coming from:
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

from fermilib-plugin-psi4.

babbush avatar babbush commented on August 18, 2024

Hi Kanav,

I am not familiar with spyder. I usually run that demo using jupyter notebook. I am not able to replicate that error message. Can you be more specific about where it is coming from? Are you saying you get this error message when you run the example ipython notebook? I have checked on linux and mac and don't see that problem.

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

Hi Ryan,
Spyder has an ipython console just like jupyter, and that is what I generally use. So, I run the code in the ipython console and it runs fine and does not print anything. But in the terminal that I used to start spyder, the code prints out some stuff, for example, I ran C2H4 and got this:

ValueError: cannot reshape array of size 20736 into shape (14,14,14,14)
Hartree-Fock energy for H4-C2_sto-3g_singlet_.757 (16 electrons) is -77.07257386831316.
MP2 energy for H4-C2_sto-3g_singlet_.757 (16 electrons) is -77.19448256858752.
CISD energy for H4-C2_sto-3g_singlet_.757 (16 electrons) is -77.2217492387305.
Traceback (most recent call last):
File "/home/kanav/anaconda3/bin/psi4", line 248, in <module>
exec(content)
File "<string>", line 146, in <module>
ValueError: cannot reshape array of size 20736 into shape (14,14,14,14)
And the output for the generate_diatomic.py file was long but I just sent you the error string. Again, it doesn't seem to create any problem. Everything seems fine, transforms and tests run fine on the files generated, so I am not sure what to make of this.

from fermilib-plugin-psi4.

babbush avatar babbush commented on August 18, 2024

Hi Kanav,

I see, so the error is just printed in the terminal while you run the ipython notebook in spyder but there is no error that shows in the ipython notebook? Assuming I understand that correctly, I am not too concerned about this. There are a huge variety of things that could cause such issues, many of them have little to do with our code. In particular, I suspect this an error in psi4 but it seems to run just fine anyways. Accordingly, I am going to close this issue (just don't look in the terminal while you run the ipython notebook)!

from fermilib-plugin-psi4.

kanavsetia avatar kanavsetia commented on August 18, 2024

Okay, sounds good!

from fermilib-plugin-psi4.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.