gbasis icon indicating copy to clipboard operation
gbasis copied to clipboard

Bad iodata support

Open kimt33 opened this issue 6 years ago • 5 comments

The module iodata is supported, technically, but not very well. iodata for which the interface was created is not available on neither pypi nor conda. It was designed for the latest iodata in the master branch of the repository https://github.com/theochem/iodata. There are some major API breaking changes from the previous version which makes the current wrapper not compatible with the ones in pypi or conda.

The setup.py references that the iodata must be greater than 0.1.7 (current version in pypi and conda), but due to reasons the latest iodata has not been pushed or versioned yet.

The fix, at the moment, is to clone the repository and install it manually

https://github.com/theochem/iodata
cd iodata
pip install --user -e .

and the pip install gbasis[iodata] is broken until iodata is available (This command wouldn't work anyways because the current version of gbasis isn't up on pypi or conda, but that'll happen soon).

See PR https://github.com/theochem/gbasis/pull/69 for some discussion

kimt33 avatar Jun 06 '19 07:06 kimt33

One can always directly install with pip from a github repo as follows. As long as we have no IOData release, this could be helpful:

pip install git+https://github.com/theochem/iodata.git@master

tovrstra avatar Jun 06 '19 08:06 tovrstra

What should be done to resolve this error message? https://github.com/theochem/gbasis/blob/master/gbasis/wrappers.py#L108

I was loading a WFN which contains only Cartesian primitives, and got this error: ValueError: Given convention does not support spherical contractions for the angular momentum 2

FarnazH avatar Jul 03 '19 15:07 FarnazH

@FarnazH @kimt33 I'd like to pick this up again. There are still a few cases for which the wrapper does not work yet.

I'm doing some prototyping for denspart, just to see which ideas could work and where we might run into problems. I wrote a fairly naive input preparation code (to set up a density on an integration grid) and check for a bunch of test files if the density integrates to the right number of electrons, see https://github.com/theochem/denspart/blob/prototype0/denspart/adapters/test/test_horton3.py

This is the output:

denspart/adapters/test/test_horton3.py::test_integrate_rho[2h-azirine-cc.fchk] PASSED [  1%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[2h-azirine-ci.fchk] PASSED [  2%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[2h-azirine-mp2.fchk] PASSED [  3%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[2h-azirine-mp3.fchk] PASSED [  4%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[atom_om2.cp2k.out] FAILED [  5%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[atom_si.cp2k.out] FAILED [  7%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[carbon_gs_ae_contracted.cp2k.out] FAILED [  8%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[carbon_gs_ae_uncontracted.cp2k.out] FAILED [  9%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[carbon_gs_pp_contracted.cp2k.out] FAILED [ 10%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[carbon_gs_pp_uncontracted.cp2k.out] FAILED [ 11%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[carbon_sc_ae_contracted.cp2k.out] FAILED [ 12%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[carbon_sc_ae_uncontracted.cp2k.out] FAILED [ 14%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[carbon_sc_pp_contracted.cp2k.out] FAILED [ 15%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[carbon_sc_pp_uncontracted.cp2k.out] FAILED [ 16%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[ch3_hf_sto3g.fchk] PASSED [ 17%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[ch3_rohf_sto3g_g03.fchk] PASSED [ 18%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[ethanol.mkl] PASSED [ 20%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[F.molden] PASSED [ 21%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h2_ccpvqz.wfn] FAILED [ 22%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h2o_error.wfx] FAILED [ 23%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h2o.molden.input] PASSED [ 24%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h2o_sto3g_decontracted.wfn] PASSED [ 25%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h2o_sto3g.fchk] PASSED [ 27%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h2o_sto3g.wfn] PASSED [ 28%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h2_sto3g.mkl] PASSED [ 29%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h2_ub3lyp_ccpvtz.wfx] FAILED [ 30%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he2_ghost_psi4_1.0.molden] FAILED [ 31%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_d_orbital.wfn] FAILED [ 32%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_p_orbital.wfn] PASSED [ 34%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_s_orbital.fchk] PASSED [ 35%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_s_orbital.wfn] PASSED [ 36%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_spdfgh_orbital.fchk] FAILED [ 37%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_spdfgh_orbital.wfn] FAILED [ 38%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_spdfgh_virtual.fchk] FAILED [ 40%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_spdfgh_virtual.wfn] FAILED [ 41%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_spdf_orbital.fchk] FAILED [ 42%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_spdf_orbital.wfn] FAILED [ 43%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_spd_orbital.fchk] FAILED [ 44%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_spd_orbital.wfn] FAILED [ 45%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_sp_orbital.fchk] PASSED [ 47%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_sp_orbital.wfn] PASSED [ 48%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_s_virtual.fchk] PASSED [ 49%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[he_s_virtual.wfn] PASSED [ 50%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[hf_sto3g.fchk] PASSED [ 51%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[h_sto3g.fchk] PASSED [ 52%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[li2_g09_nbasis_indep.fchk] FAILED [ 54%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[li2.mkl] FAILED [ 55%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[li2.molden.input] FAILED [ 56%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[lif_fci.wfn] PASSED [ 57%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[li_h_3-21G_hf_g09.fchk] PASSED [ 58%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[lih_cation_cisd.wfn] PASSED [ 60%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[lih_cation_cisd.wfx] PASSED [ 61%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[lih_cation_fci.wfn] PASSED [ 62%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[lih_cation_rohf.wfn] PASSED [ 63%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[lih_cation_rohf.wfx] PASSED [ 64%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[lih_cation_uhf.wfn] PASSED [ 65%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[lih_cation_uhf.wfx] PASSED [ 67%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[li_sp_orbital.wfn] PASSED [ 68%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[li_sp_virtual.wfn] PASSED [ 69%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[monosilicic_acid_hf_lan.fchk] PASSED [ 70%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[neon_turbomole_def2-qzvp.molden] FAILED [ 71%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nh3_molden_cart.molden] FAILED [ 72%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nh3_molden_pure.molden] PASSED [ 74%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nh3_molpro2012.molden] FAILED [ 75%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nh3_orca.molden] PASSED [ 76%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nh3_psi4_1.0.molden] PASSED [ 77%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nh3_psi4.molden] PASSED [ 78%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nh3_turbomole.molden] FAILED [ 80%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nitrogen-cc.fchk] PASSED [ 81%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nitrogen-ci.fchk] PASSED [ 82%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nitrogen-mp2.fchk] PASSED [ 83%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[nitrogen-mp3.fchk] PASSED [ 84%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[o2_cc_pvtz_cart.fchk] FAILED [ 85%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[o2_cc_pvtz_pure.fchk] PASSED [ 87%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[o2_uhf_virtual.wfn] FAILED [ 88%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[o2_uhf.wfn] FAILED [ 89%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[peroxide_irc.fchk] PASSED [ 90%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[peroxide_opt.fchk] PASSED [ 91%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[peroxide_relaxed_scan.fchk] PASSED [ 92%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[peroxide_tsopt.fchk] PASSED [ 94%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[water_ccpvdz_pure_hf_g03.fchk] PASSED [ 95%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[water_dimer_ghost.fchk] PASSED [ 96%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[water_hfs_321g.fchk] PASSED [ 97%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[water_sto3g_hf_g03.fchk] PASSED [ 98%]
denspart/adapters/test/test_horton3.py::test_integrate_rho[water_sto3g_hf.wfx] PASSED [100%]

======================== 33 failed, 52 passed in 15.24s ========================

The full output is attached. pytest.txt

I may be doing some obvious things wrong in the prepare_input code. I'll try to understand where these errors come from.

tovrstra avatar Jan 28 '20 05:01 tovrstra

Have we got this issue under control? We should ideally have a semi-seamless integration to/from IOData.

PaulWAyers avatar Jul 09 '20 15:07 PaulWAyers

@PaulWAyers We're getting there. Here is a short list of remaining issues to fix:

  • My only serious remaining concern is #113, but it is more general than just IOData support.
  • It seems that the problem solved in theochem/gbasis#104 also exists in related files base_two_symm.py, base_two_asymm.py and base_four.py. I've opened an issue for this: #114.
  • We may have to adapt the from_iodata code in wrapper.py after theochem/iodata#157 gets merged.
  • I discovered the source of the last failing test in the denspart prototype, but this was unrelated to gbasis. (See theochem/grid#99.)

tovrstra avatar Jul 28 '20 10:07 tovrstra

@tovrstra Is there anything else that needs to be fixed/improved for proper iodata support?

FarnazH avatar Jun 22 '24 15:06 FarnazH

I just ran a few quick tests and the interface works on my end with the latest GBasis and IOData commits. I think everything is fixed.

I'm going through a few api-breaking changes in IOData that should be done before its elusive yet imminent 1.0.0 release. If any of these affect GBasis, I'll make a pull request to make sure everything works again.

tovrstra avatar Jun 22 '24 17:06 tovrstra

For me, it is ok to close this issue, unless there are other concerns that I've missed?

tovrstra avatar Jun 22 '24 17:06 tovrstra

I'll close it. I think we've addressed most of the main issues and as we are using iodata and gbasis in the same workflows now more and more, issues that arise will naturally be identified organically in specific contexts.

PaulWAyers avatar Jun 23 '24 15:06 PaulWAyers