Giter VIP home page Giter VIP logo

frankwswang / quiqbox.jl Goto Github PK

View Code? Open in Web Editor NEW
31.0 3.0 2.0 11.17 MB

Exploring the computational power of fermionic quantum systems. Ab initio computation and basis set optimization for electronic structure problems.

Home Page: https://frankwswang.github.io/Quiqbox.jl/stable

License: MIT License

Julia 100.00%
quantum quantum-chemistry molecule electronic-structure julia automatic-differentiation computational-chemistry many-body-physics molecular-integrals basis-set

quiqbox.jl's Introduction

Quiqbox.jl

Quiqbox is a quantum chemistry and quantum physics software package that starts around Gaussian basis set optimization for electronic structure problems. Quiqbox is written in pure Julia. This work is supported by the U.S. Department of Energy under Award No. DESC0019374.

Documentation Digital Object Identifier Publication License
License: MIT
Development Status
codecov CI CI-JN

Features

  • Native 1-electron and 2-electron integral functions.
  • Floating and fixed-position contracted Gaussian-type orbital (CGTO).
  • Mixed-contracted GTO (linear combination of GTOs with mixed centers or orbital angular momentum) as a basis function.
  • Restricted (closed-shell) and unrestricted (open-shell) Hartree–Fock methods (RHF & UHF).
  • Variational optimization of basis set parameters based on a hybrid analytical differentiation design combining automatic differentiation (AD) and symbolic differentiation (SD).

Setup

OS (64-bit) support

  • Generic Linux
  • macOS
  • Windows

NOTE: Each operating system (OS) platform is only tested on the x86-64 architecture. The support of those systems on different architectures (such as macOS on ARM architecture) is not guaranteed.

Julia (64-bit) compatibility

Quiqbox will always try to support the latest stable release of 64-bit Julia as soon as possible. On the other hand, backward compatibility with previous versions is not guaranteed but can be checked here.

Installation in Julia REPL

Type ] in the default Julian mode to switch to the Pkg mode:

(@v1.x) pkg>

Type the following command and hit Enter key to install Quiqbox:

(@v1.x) pkg> add Quiqbox

After the installation completes, hit the Backspace key to go back to the Julian mode and use using to load Quiqbox:

julia> using Quiqbox

Showcase

Combine atomic orbitals

points = GridBox((1,0,0), 1.4).point

bsH₂ = vcat(genBasisFunc.(points, "STO-3G")...)

Build a customized basis set

gf = GaussFunc(1.0, 0.75)

bs = genBasisFunc.(points, Ref(gf)) .+ bsH₂

Run the Hartree–Fock method

nuc = ["H", "H"]

coords = coordOf.(points)

runHF(bs, nuc, coords)

Optimize the basis set

pars = markParams!(bs, true)

optimizeParams!(pars, bs, nuc, coords)

Documentation

Objects defined by Quiqbox that are directly exported to the user have the corresponding docstring, which can be accessed through the Help mode in Julia REPL. The latest release's documentation contains all the docstrings and additional tutorials of the package. For unreleased/experimental features, please refer to the developer documentation.

Citation

If you use Quiqbox in your research, please cite the following paper:

  • Wang, W., & Whitfield, J. D. (2023). Basis set generation and optimization in the NISQ era with Quiqbox.jl. Journal of Chemical Theory and Computation, 19(22), 8032-8052.


Whitfield Group


quiqbox.jl's People

Contributors

frankwswang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

quiqbox.jl's Issues

General combinations of functions with shared parameters

I would like to create a basis set with the following 5 functions and unique sets of parameters alpha, beta, gamma, and position a.

  1. 1S type orbital GTO(alpha, [0,0,0])
  2. 2S type orbital GTO(beta, [0,0,0])
    2P type delocalized orbitals
  3. GTO(gamma, [a, 0, 0]) - GTO(gamma, [-a, 0, 0])
  4. GTO(gamma, [0, a, 0]) - GTO(gamma, [0, -a, 0])
  5. GTO(gamma, [0, 0, a]) - GTO(gamma, [0, 0, -a])

Where GTO are Gaussian Type Orbitals and alpha/beta/gamma are the GTO parameters and "a" is the delocalization.

benchmark against openfermion, unit issues

Hi,
Neat work!
I just tried to do some benchmark of Quiqbox.jl against openfermion, but got some unit issues. For H2 molecule with bond length of 0.275 angstrom, the Hartree Fock energy calculated from openfermion is -0.46576 Ha, while the result I got from Quiqbox.jl is -2.53861 Ha. I think it must be a unit issues, but I'm not sure where it is. The piece of code I used for the calculation is as below:

using Quiqbox

function calc_H2()
    bond_length = 0.275
    nuc = ["H", "H"]
    nucCoords = [[0.0, 0.0, 0.0], [0.0, 0.0, bond_length]]
    bs = genBasisFunc.(nucCoords, ("STO-3G", "H") |> Ref) |> flatten

    resRHF = runHF(bs, nuc, nucCoords)
    println("Quiqbox:")
    println("bond length = ", bond_length)
    @show resRHF.Ehf
    println()
end 


using PyCall
py"""
from openfermion.chem import MolecularData
from openfermionpyscf import run_pyscf
def get_H2():
    bond_length = 0.275
    geometry = [
                ["H", [0.0, 0.0, 0.0]],
                ["H", [0.0, 0.0, bond_length]],
            ]

    basis = "sto3g"
    spin = 0

    molecule_of = MolecularData(
        geometry,
        basis,
        multiplicity=2 * spin + 1
    )
    molecule_of = run_pyscf(
        molecule_of,
        run_scf=1,
        run_ccsd=0,
        run_fci=0
    )
    print("openfermion:")
    print('At bond length of {} angstrom, molecular hydrogen has:'.format(
        bond_length))
    print('Hartree-Fock energy of {} Hartree.'.format(molecule_of.hf_energy))
""" 


calc_H2()
py"get_H2"()

The result is as below:

Quiqbox:
bond length = 0.275
resRHF.Ehf = -2.538611549467369

openfermion:
At bond length of 0.275 angstrom, molecular hydrogen has:
Hartree-Fock energy of -0.46576369202200985 Hartree.

For more detailed examples of openfermion, please refer to this

Thanks a lot in advance!

The easiest way to get the Hamiltonian in second quantization?

Hi,
I would like to get the Hamiltonian in the second quantization after HF calculation, i.e. the coefficient matrix of the Hamiltonian in the Fock space given the basis set calculated by HF method. This is the first step of post-HF method, including FCI and quantum computing algorithms(such as VQE) I'm working on.

I did a little bit of review of the Quiqbox.jl code, and found that maybe I can do it using functions provided by src/Integrals/OneBody.jl and src/Integrals/TwoBody.jl, following the Slater's rules.

Do you have any suggestions for this, and what is the easiest way to achieve this in Quiqbox.jl ?

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

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.