Skip to content
New issue

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

Setting up an environment for quantum computing #107

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

cryos
Copy link
Member

@cryos cryos commented May 15, 2020

This is a baseline set of Python modules and a QM code (Psi4) to do some
basic quantum computing simulation.

This is a baseline set of Python modules and a QM code (Psi4) to do some
basic quantum computing simulation.

Signed-off-by: Marcus D. Hanwell <[email protected]>
@cryos cryos requested a review from muammar May 15, 2020 22:44
@cryos
Copy link
Member Author

cryos commented May 15, 2020

This was pushed to openchemistry/quantum:dev too @muammar and @wadejong

Copy link
Collaborator

@muammar muammar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The projectq module is failing to build with the error below:

pp_opts.append("-I%s" % dir)
   File "/tmp/pip-install-x4_s57sy/projectq/setup.py", line 63, in __str__
     import pybind11
 ModuleNotFoundError: No module named 'pybind11'
 ----------------------------------------
 ERROR: Failed building wheel for projectq

RUN apt-get update && \
apt-get install -y libblas-dev liblapack-dev && \
cd /root && \
pip install -r requirements.txt && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before installing the modules in requirements.txt, one needs to add the line:

pip install pybind11 && \

This avoids a problem when building projectq (see line 3 of requirements.txt). After doing that change, my image was built and I could test qiskit.

Screen Shot 2020-05-21 at 16 58 40

mkdir build && \
cd build && \
cmake ../psi4-1.3.2 && make -j10 install && \
rm -rf /usr/local/psi4/share/psi4/samples && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the psi4 inside the image and it's failing with the following:

  root@2fc7f25c76b0:/tmp# /usr/local/psi4/bin/psi4 input.dat
Traceback (most recent call last):
  File "/usr/local/psi4/bin/psi4", line 287, in <module>
    exec(content)
  File "<string>", line 35, in <module>
  File "/usr/local/psi4/lib/psi4/driver/driver.py", line 556, in energy
    wfn = procedures['energy'][lowername](lowername, molecule=molecule, **kwargs)
  File "/usr/local/psi4/lib/psi4/driver/procrouting/proc.py", line 2002, in run_scf
    scf_wfn = scf_helper(name, post_scf=False, **kwargs)
  File "/usr/local/psi4/lib/psi4/driver/procrouting/proc.py", line 1276, in scf_helper
    base_wfn = core.Wavefunction.build(scf_molecule, core.get_global_option('BASIS'))
  File "/usr/local/psi4/lib/psi4/driver/p4util/python_helpers.py", line 115, in _core_wavefunction_build
    basis = core.BasisSet.build(mol, "ORBITAL", basis)
  File "/usr/local/psi4/lib/psi4/driver/p4util/python_helpers.py", line 80, in _pybuild_basis
    mol.to_dict(), key, resolved_target, fitrole, other, return_dict=True, return_atomlist=return_atomlist)
  File "/usr/local/psi4/lib/psi4/driver/qcdb/molecule.py", line 1461, in to_dict
    compare_molrecs(validated_molrec, molrec, 6, 'to_dict', forgive=forgive, verbose=0)
  File "/usr/local/psi4/lib/psi4/driver/qcdb/psiutil.py", line 255, in compare_molrecs
    compare_dicts(xptd, cptd, tol, label, forgive=forgive, verbose=verbose)
  File "/usr/local/psi4/lib/psi4/driver/qcdb/psiutil.py", line 152, in compare_dicts
    raise ImportError("""Python module deepdiff not found. Solve by installing it: `conda install deepdiff -c conda-forge` or `pip install deepdiff`""")

ImportError: Python module deepdiff not found. Solve by installing it: `conda install deepdiff -c conda-forge` or `pip install deepdiff`

Printing out the relevant lines from the Psithon --> Python processed input file:
    ""","cswater")
    core.IO.set_default_namespace("cswater")
    oswater = cswater.clone()
    oswater.set_multiplicity(2)
    oswater.set_molecular_charge(1)
--> e = energy('b3lyp', molecule=cswater)
    core.set_global_option("REFERENCE", "uhf")
    e = energy('b3lyp', molecule=oswater)
    core.set_global_option("REFERENCE", "rks")
    e = energy('b3lyp5', molecule=cswater)
    core.set_global_option("REFERENCE", "uks")

The example I was trying to run is: https://github.com/psi4/psi4/blob/master/samples/dft-b3lyp/input.dat

jinja2
cmake
pint
pydantic
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add deepdiff to the list of requirements.

@cjh1
Copy link
Member

cjh1 commented Oct 16, 2020

I have pushed the changes suggested by @muammar ( thanks 😄 ) psi4 will now run. @cryos It looks like we are missing python script for the entrypoint, does this exist? Or does it need to be written?

@cryos
Copy link
Member Author

cryos commented Oct 17, 2020

It needs to be written, I was going to base it on what Bert shared in quantum notebooks.

@cjh1
Copy link
Member

cjh1 commented Oct 19, 2020

@cryos It looks like there are a couple of notebooks/calculations which one where we planning on using?

@cryos
Copy link
Member Author

cryos commented Oct 20, 2020

@cjh1 I hadn't decided, I was just going to pick one and get something working to ensure all the pieces were functional. If it runs I think that needs some input from Bert on the next step as they are just examples that may not form the best driver. It might be good to get together and refresh on what we want to get into the driver/container.

@wadejong
Copy link

wadejong commented Oct 20, 2020 via email

Signed-off-by: Brianna Major <[email protected]>
This calculation code comes from the notebook provided here:
https://github.com/OpenChemistry/quantumnotebooks/blob/master/OpenChemistry-Quantum.ipynb

Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Include Psi4 energy and properly format coordinates

Signed-off-by: Brianna Major <[email protected]>
@bnmajor
Copy link
Contributor

bnmajor commented Jan 5, 2021

An explanation of the changes made up until a5edc5f can be found in this comment

@cjh1
Copy link
Member

cjh1 commented Jan 14, 2021

@bnmajor Could you provide a notebook showing how this container can be invoked?

@bnmajor
Copy link
Contributor

bnmajor commented Jan 14, 2021

@cjh1 Yes I'll work on one

- `tag`: <strong>1.0</strong>
- `digest`: <strong>123</strong> (can be any value)
- `clusterId`: (from GET /clusters)
- `size`: <strong>2</strong> (can be any value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to do this via the UI @psavery? Also how do we get it registered automatically in the dev environment?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we needed to add it to this list.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cjh1 Yeah, that's to register it automatically.

You can also manually register it via the girder endpoint at localhost:8080/api/v1 under "images". If you do this, you can put whatever you want for the digest and the size, the digest is only used to see if the image has already been registered. The size isn't used for anything but display.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnmajor Lets add openchemistry/qiskit to the list to be added automatically, then I think we can remove this block.

Copy link
Contributor

@psavery psavery Feb 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might also want to add it here, and here

Copy link
Member

@cjh1 cjh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnmajor This works for me with the sample notebook with the inchikey change. Looking good, couple of inline comments.

docker image:

```
docker build -t quantum:1.0 .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets tag the image openchemistry/qiskit

- `tag`: <strong>1.0</strong>
- `digest`: <strong>123</strong> (can be any value)
- `clusterId`: (from GET /clusters)
- `size`: <strong>2</strong> (can be any value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnmajor Lets add openchemistry/qiskit to the list to be added automatically, then I think we can remove this block.

@cjh1
Copy link
Member

cjh1 commented Feb 25, 2021

Here is the sample notebook.

@cjh1
Copy link
Member

cjh1 commented Feb 25, 2021

Any feedback @cryos @wadejong? We are going to merge soon.

bnmajor added 2 commits March 3, 2021 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants