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

Nexus PySCF interface #1220

Merged
merged 5 commits into from
Dec 7, 2018
Merged

Nexus PySCF interface #1220

merged 5 commits into from
Dec 7, 2018

Conversation

jtkrogel
Copy link
Contributor

@jtkrogel jtkrogel commented Dec 6, 2018

This PR contains a Nexus interface to PySCF. The idea is to be able to drive arbitrary PySCF scripts (based on template files), with the possibility for follow-on QMCPACK calculations.

Generation of Mole/Cell input and the additional conversion step via savetoqmcpack are automated.

Anticipate completion in a day or so.

Tasks:

  • Create PyscfInput class to generate/write PySCF scripts based on template files
  • Create null PyscfAnalyzer and main Pyscf simulation classes
  • Create orbital workflow dependency for PySCF -> QMCPACK
  • Verify that Mole/Cell input generation works
  • Verify that managed PySCF runs work
  • Verify that managed PySCF+QMCPACK runs work
  • Final adjustments for production runs

@ghost ghost assigned jtkrogel Dec 6, 2018
@ghost ghost added the in progress label Dec 6, 2018
@qmc-robot
Copy link

Can one of the maintainers verify this patch?

1 similar comment
@qmc-robot
Copy link

Can one of the maintainers verify this patch?

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 6, 2018

Ready for review.

@jtkrogel jtkrogel changed the title [WIP] Nexus PySCF interface Nexus PySCF interface Dec 6, 2018
@markdewing
Copy link
Contributor

okay to test

@markdewing
Copy link
Contributor

Are examples and/or tests coming?

One of the problems with Nexus is discoverability. It has a huge number of features and it's hard to find out what they are. Nexus doesn't document the features of the code it drives (nor should it - that's far too involved), so one has to read the documentation for the target code, and then figure out how to get Nexus to generate that feature.
One problem with code generators or template systems is trying to visualize and understand how changes in the Nexus input change the generated code. Or as mentioned above, the inverse problem of knowing the desired result in the generated code and figuring out how to change the Nexus input to get that result.

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 6, 2018

I completely agree. The best I can do is provide examples, which are coming (if slowly) and go through things in more detail during the monthly calls.

This is going in now because it enables science Anouar and I are pursuing immediately.

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 6, 2018

Below is an example if you want to try it out (based on the h2o example included in PySCF):

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 6, 2018

#! /usr/bin/env python

from nexus import settings,job,run_project,obj
from nexus import generate_physical_system
from nexus import generate_pyscf

settings(
    results = '',
    sleep   = 3,
    machine = 'ws1',
    )

h2o = generate_physical_system(
    elem_pos = '''
        O 0 0      0
        H 0 -2.757 2.587
        H 0  2.757 2.587''',
    units = 'A',
    )

scf = generate_pyscf(
    identifier = 'scf',
    path       = '',
    job        = job(cores=1,serial=True),
    template   = './01-h2o.py',
    system     = h2o,
    mole       = obj(
        verbose  = 5,
        basis    = 'ccpvdz',
        symmetry = 1,
        ),
    )

run_project()

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 6, 2018

Contents of 01-h2o.py (the template):

#!/usr/bin/env python

from pyscf import scf

$system

mf = scf.RHF(mol)
mf.kernel()

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 6, 2018

PySCF is distributed under Apache 2.0 license, is this compatible with ours?

@markdewing
Copy link
Contributor

Do you want to include PySCF examples in nexus? Or something else - what do you want to do that involves license policy?

@prckent
Copy link
Contributor

prckent commented Dec 6, 2018

Why the license concern? We shouldn't be copying any files from PySCF to have a clean situation. Any examples similar to those in PySCF should be cleanly rewritten.

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 6, 2018

PySCF has a very large number of examples. Demonstrating how to do some of these with Nexus would be ideal--not copying but basing new files (e.g. the templates) off of them, with any attribution as required. A situation like this, AFAIK, is a good example of why codes are released as open source.

Apache considers UIUC to be similar to its own license: http://www.apache.org/legal/resolved.html#category-a. There does not appear to be a large risk so long as the requirements are observed. Is there one I am missing?

Apart from risk, I can understand not wanting to do the added work of meeting the requirements. I'm quite open to everyone's advice on this.

@prckent
Copy link
Contributor

prckent commented Dec 6, 2018

Is there anything in this PR from PySCF covered by their license? Yes or No? I need a clear answer before we can merge.

As for adding examples of using other codes, I prefer that we only add files covered by our license. We already do this for other codes.

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 7, 2018

There is nothing in this PR covered by their license.

The example in the comments above (01-h2o.py, not included anywhere in mergable files) was derived from one of their files.

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 7, 2018

If this point is sticky on its own, I can delete the comment.

@jtkrogel
Copy link
Contributor Author

jtkrogel commented Dec 7, 2018

Anything else needed here?

@prckent
Copy link
Contributor

prckent commented Dec 7, 2018

Thanks Jaron. Just wanted to be sure.

@ghost ghost assigned prckent Dec 7, 2018
@markdewing markdewing merged commit 7524817 into QMCPACK:develop Dec 7, 2018
@ghost ghost removed the in progress label Dec 7, 2018
@jtkrogel jtkrogel deleted the nx_pyscf branch January 8, 2019 16:51
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.

4 participants