Skip to content

Added PBC FCIDUMP code#1

Open
ajwt wants to merge 9 commits into
masterfrom
pbcfcidump
Open

Added PBC FCIDUMP code#1
ajwt wants to merge 9 commits into
masterfrom
pbcfcidump

Conversation

@ajwt
Copy link
Copy Markdown
Member

@ajwt ajwt commented Dec 19, 2022

Added PBC FCIDUMP code

ajwt added 3 commits December 19, 2022 15:47
This dumps complex integrals from the pbc k-point code as well as
exchange truncated integrals.

Contributor List:

Alex Thom
Verena Neufeld
David Kovacs
Jiri Etrych
    Contributor List:

    Verena Neufeld
    Alex Thom
    David Kovacs
    Jiri Etrych
@verena-neufeld
Copy link
Copy Markdown
Member

verena-neufeld commented Jan 1, 2023

Thanks for tagging me here, I've pushed some suggested changes to branch review_jan01 . The main suggested change is removal of need for changes in main pyscf by not creating a new eri array. This also saves memory.

Copy link
Copy Markdown
Member

@verena-neufeld verena-neufeld left a comment

Choose a reason for hiding this comment

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

some small comments

Comment thread pyscf/tools/pbcfcidump.py Outdated
for kq in range(nkpts):
for kr in range(nkpts):
ks = kconserv[kp, kq, kr]
# The documentation in pyscf/pbc/lib/kpts_helper.py in
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure (anymore) what is meant here with an inconsistency. The code in kpts_helper.py seems ok to me. Can you clarify this comment or remove it?

Copy link
Copy Markdown
Member Author

@ajwt ajwt Jan 16, 2023

Choose a reason for hiding this comment

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

I trace this back to https://github.com/pyscf/pyscf/blob/1.3/pbc/tools/pbc.py
Need to investigate further.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment now updated.

Comment thread pyscf/tools/pbcfcidump.py
return nar, l, dspls, counts # p


def exchange_integrals(comm, mf, nmo, kconserv, fout, kstart, kpts):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this function is slow. An alternative is getting the eris the same way as without exchange treatment but telling pyscf to use exchange treatment there. Might require modifications in main pyscf code though...

Comment thread pyscf/tools/pbcfcidump.py Outdated
for p in range(nmo):
for pk in range(nkpts):
for q in range(nmo):
# The documentation in pyscf/pbc/lib/kpts_helper.py in
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

see previous comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment now updated.

Comment thread pyscf/tools/pbcfcidump.py
exchange_integrals(comm, mf, nmo, kconserv, fx, kstart, mf.kpts)
if rank == 0:
fx.close()
# MP meshes with an even number of points in a dimension do not contain
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this is correct. PySCF's meshes contain the gamma point by default. Might not be gamma centred (not sure this matters?).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Monkhorst-Pack even meshes would properly not contain the gamma point (https://journals.aps.org/prb/pdf/10.1103/PhysRevB.13.5188) but this isn't apparently followed everywhere (https://www.c2x.org.uk/mp_kpoints.htm)

A2B = 1.889725989


def get_ase_atom(formula):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how similar to pbc/tools/lattice.py?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Very! Have removed and called that code.

@verena-neufeld
Copy link
Copy Markdown
Member

In favour of more minimal code additions, I wonder whether the helpers should be deleted and instead examples could be added so that users know how to use pbc fcidump. This would feel more in line with main pyscf.

@verena-neufeld
Copy link
Copy Markdown
Member

I hope this is helpful for now. It was quite a while ago I had looked at this before :D .

verena-neufeld and others added 4 commits January 1, 2023 15:35
- remove need to modify kccsd_rhf.py
Removed outdated comments about get_kconserv
@ajwt
Copy link
Copy Markdown
Member Author

ajwt commented Jan 17, 2023

Thanks for tagging me here, I've pushed some suggested changes to branch review_jan01 . The main suggested change is removal of need for changes in main pyscf by not creating a new eri array. This also saves memory.

Thanks for this edit - it's a lot cleaner for integration. I've merged that branch into this. FCIDUMP Tests still pass.

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.

2 participants