broadway-edft

Broadway code for implementing ensemble DFT and mathematically similar theories

https://github.com/gambort/broadway-edft

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Broadway code for implementing ensemble DFT and mathematically similar theories

Basic Info
  • Host: GitHub
  • Owner: gambort
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Size: 68.4 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created almost 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Citation

README.md

Broadway-EDFT

Broadway code for implementing ensemble DFT and mathematically similar theories

Note, you need a working copy of psi4 or pyscf to use Broadway. The psi4 interface is recommended, more fully featured, and used for examples.

Installation

Broadway has not been designed as a package or library, as it is intended to be used for both demonstration and development purposes. To install, simply download the code and sub-directories to the directory you intend to call it from. Alternatively, use links if you wish changes to be shared in multiple projects.

Basic use

The key steps for using Broadway are: 1) Run an initial psi4 (or pyscf) calculation and return the wavefunction (or scf) object 2) Pass the wavefunction (or scf) object to the correct Engine 3) Create an EDFT class from the Engine, and use it to compute things.

Worked example

1) Run an initial psi4 calculation and return the wavefunction

```python import psi4

psi4.set_options({ "reference": "rhf", # Start from RHF "basis": "cc-pvdz", # Set the basis })

psi4.geometry("O\nH 1 0.96\nH 1 0.96 2 103") # Set up a water

Run a PBE0 calculation of water and return the wavefunction as wfn

Epsi4, wfn = psi4.energy("pbe0", returnwfn=True) ```

2) Pass the wavefunction to the Engine

python from psi4Engine.Engine import psi4Engine Engine = psi4Engine(wfn)

3) Create an EDFT class from the Engine, and use it to compute things

```python

We will do full orbital optimized EDFT using the OOEDFT class

from Broadway.OOEDFT import *

Set up the excitation helper

XHelp = OOExcitationHelper(Engine, Report=3)

Get the doubly occupied "ground state" and test against psi4

EGS = XHelp.SolveGS() if np.abs(EGS-E_psi4)>1e-4: print("Energy is not the same as psi4. If you ran a doubly occupied" + " this indicates a problem.") quit()

Calculate the singly-promoted singlet with h->l

E_SX = XHelp.SolveSX()

Calculate the doubly-promoted singlet with h^2->l^2

E_DX = XHelp.SolveDX()

print('='72) print("S0->S1 energy : %6.2f eV"%(27.2(ESX-EGS))) print("S0->S2 energy : %6.2f eV"%(27.2(EDX-EGS))) print("S1->S2 energy : %6.2f eV"%(27.2(EDX-ESX))) ```

This should yield an output whose last four lines are:

```

S0->S1 energy : 8.16 eV S0->S2 energy : 28.35 eV S1->S2 energy : 20.18 eV ```

Caution when doing double excitations

Double excitations are solved directly via orbital optimization. In normal use cases where the excitation is symmetry protected or is otherwise low energy and stable, the double excitation code will converge smoothly to a variational minima.

However, in rare cases (usually high energy double excitations) the orbital optimization will instead settle to the `ground state orbitals, by swapping l<->h. There are two signatures of this behaviour: i) the energy of the double excitation will be lower than that of the corresponding single exciation with the same orbitals; ii) the algorithm will iterate for a larger-than-usual (typically over 50) number of steps. In such cases the energy should be discarded.

Owner

  • Login: gambort
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Gould"
  given-names: "Tim"
  orcid: "https://orcid.org/0000-0002-7191-9124"
title: "Broadway - an EDFT library for python"
version: 1.0.0
doi: 10.5281/zenodo.1234
date-released: 2024-04-04
url: "https://github.com/gambort/Broadway-EDFT"

GitHub Events

Total
Last Year