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

Full and approximate polaritonic ADC energies up to second order #153

Open
wants to merge 69 commits into
base: master
Choose a base branch
from

Conversation

BauerMarco
Copy link

In the following polaritonic is always referred to by QED (Quantum Electrodynamics)

Features:

  • QED-MP up to second order from QED-HF reference and standard HF
  • QED-ADC up to second order from QED-HF
  • QED-ADC up to first order from standard HF
  • Method, which approximates QED-ADC up to second order from QED-HF

All features have been tested thoroughly, although only the methods based on a QED-HF reference should be used, since they are available up to second order.
One can also request QED-ADC(2) from a QED-HF reference with the polaritonic coupling only expanded up to first order, which is correct, but it is not sure, how useful this feature really is...This has to be tested in a future benchmark.

New Keywords:

  • coupl: Coupling strength to the cavity mode
  • freq: Energy of the cavity mode
  • qed_hf: Whether a QED-HF reference is provided or not (default is True)
  • qed_approx: Use standard or approximated method (default is False, but should be set to True after a proper benchmark)
  • qed_full_diag: If full diagonalization of the QED matrix is requested (with qed_approx = False), you should use this guess

Additional comments:

  • The tests do not use a QED-HF reference, but still use qed_hf = True, so they can still be tested with any of the possible backend options adcc provides.
  • As far as I know, there are two QED-HF reference implementations available from open source, which are the hilbert package developed by the DePrince group, which is a plugin to the psi4 programm package, and an other quite basic implementation in the Polaritonic section of the psi4numpy, which is meant for educational purposes, but can be used just as well as the hilbert package. I will provide some examples for the website, after the reviewing process is done.
  • I should mention, that the corresponding paper is not published yet, so I could not reference it at the appropriate places in the code.

BauerMarco added 30 commits July 1, 2021 10:37
…due to the doubles symmetry of the independent blocks
…avidson intermediate results can now be given to Lanczos after e.g. max_iter is reached, for arbitrary convergence, since Davidson crashes for high omega and/or coupling. Triplet multiplicity for n_states calculation still occurs.
… now)...probably some factors are still wrong
…lemented the full_diagonalization option, where a full QED guess, (3 * adc_matrix + 2) guesses, is build. Care that at the moment the H_1 two particle part of the phot/elec ph_ph coupling blocks has been commented out, since this results in the matrix, that can be tested with the dipole property only.
… account, while electronic terms (including vacuum coupling to the quantized field) are taken into account through second order.
@lgtm-com
Copy link

lgtm-com bot commented Aug 9, 2022

This pull request introduces 4 alerts when merging 671183b into e58bc07 - view on LGTM.com

new alerts:

  • 3 for Unused exception object
  • 1 for Testing equality to None

@maxscheurer
Copy link
Member

Thanks for the contribution! This will, however, take some time to digest, but there are probably ways to make the integration of QED less "invasive" in the existing code structure, right @mfherbst? 👍

@mfherbst
Copy link
Member

Cool! Thanks for the contribution @BauerMarco.

Indeed, quite a bit of code. Some looks like duplications that can be avoided. I have to admit that I lack the time to review the code without some explanation what's going on. Would be good to have a chat at some point.

…. Furthermore, qed parameters are now passed directly into the ReferenceState, easing up conditions.
@BauerMarco
Copy link
Author

Cool! Thanks for the contribution @BauerMarco.

Indeed, quite a bit of code. Some looks like duplications that can be avoided. I have to admit that I lack the time to review the code without some explanation what's going on. Would be good to have a chat at some point.

I am available after the STC ends (22nd of september) and would very much appreciate to have a chat.

BauerMarco and others added 3 commits October 4, 2022 16:14
…n-polaritonic hf reference. Also missing indentation, leading to unbounded errors in backends init has been inserted.
…ity, due to an imaginary contribution on the diagonal of the final qed-matrix, which is requested as imaginary part of the cavity photon energy
qed approx methods now accounts for photon losses in the cavity via imaginary frequency
Copy link
Author

@BauerMarco BauerMarco left a comment

Choose a reason for hiding this comment

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

initial review cycle

@@ -130,21 +134,35 @@ def __init__(self, method, hf_or_mp, block_orders=None, intermediates=None,
self.ndim = 2
self.extra_terms = []

if self.reference_state.qed:
Copy link
Author

Choose a reason for hiding this comment

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

check with cvs, whether .qed or .is_qed or etc.

"adc0": dict(ph_ph=0, ph_pphh=None, pphh_ph=None, pphh_pphh=None), # noqa: E501
"adc1": dict(ph_ph=1, ph_pphh=None, pphh_ph=None, pphh_pphh=None), # noqa: E501
"adc2": dict(ph_ph=2, ph_pphh=1, pphh_ph=1, pphh_pphh=0), # noqa: E501
"adc2x": dict(ph_ph=2, ph_pphh=1, pphh_ph=1, pphh_pphh=1), # noqa: E501
"adc3": dict(ph_ph=3, ph_pphh=2, pphh_ph=2, pphh_pphh=1), # noqa: E501
}

qed_default_block_orders = {
Copy link
Author

Choose a reason for hiding this comment

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

merge dicts

adcc/workflow.py Outdated
@@ -47,7 +50,8 @@ def run_adc(data_or_matrix, n_states=None, kind="any", conv_tol=None,
n_guesses_doubles=None, output=sys.stdout, core_orbitals=None,
frozen_core=None, frozen_virtual=None, method=None,
n_singlets=None, n_triplets=None, n_spin_flip=None,
environment=None, **solverargs):
environment=None, coupl=None, freq=None, qed_hf=True,
qed_approx=False, qed_full_diag=False, **solverargs):
Copy link
Author

Choose a reason for hiding this comment

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

helper function for qed_full_diag

# and print the result
orben_a = np.asarray(self.wfn.epsilon_a())
orben_b = np.asarray(self.wfn.epsilon_b())
if all(orben_a == orben_b):
Copy link
Author

Choose a reason for hiding this comment

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

return all(orben_a == orben_b)

else:
print("This is an unrestricted calculation")
return False
else:
Copy link
Author

Choose a reason for hiding this comment

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

if isinstance(self.wfn, (psi4.core.RHF...
if isinstance(self.wfn, (psi4.core.UHF)):
else:
wavefunction object

@@ -217,3 +219,160 @@ def __radd__(self, other):
else:
ret = {k: other + tensor for k, tensor in self.items()}
return AmplitudeVector(**ret)


class QED_AmplitudeVector:
Copy link
Author

Choose a reason for hiding this comment

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

merge this class with AmplitudeVector

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.

3 participants