GithubHelp home page GithubHelp logo

Comments (12)

kgasperich avatar kgasperich commented on June 27, 2024

Thanks for pointing this out, we'll look into it
@anbenali
@TApplencourt

from qp2.

kgasperich avatar kgasperich commented on June 27, 2024

@tbhuber do you have a small example so we can be sure we're reproducing the same issue?
thanks!

from qp2.

kgasperich avatar kgasperich commented on June 27, 2024

Here is a small example that shows this.
The <S^2> in the fci and pt2 output don't match.
pt2-s2-issue.tar.gz

from qp2.

eginer avatar eginer commented on June 27, 2024

from qp2.

kgasperich avatar kgasperich commented on June 27, 2024

We have identified the issue, and it should be fixed soon.
It looks like it's just a problem with what's being printed, so your wavefunction and energy are all still correct.

When pt2 is called, it builds psi_s2 from the provider, and this sets it to <S^2> - S_z*(S_z-1) (or <S_+ S_-> in terms of ladder operators).

When fci is called, it sets psi_s2 equal to CI_S2, and this is shifted by S_z*(S_z-1)
The shift is applied here for full diagonalization, and here for the davidson.

So the <S^2> in the fci output is actually <S^2>, and the value from the pt2 output is <S^2> - S_z*(S_z-1).

from qp2.

kgasperich avatar kgasperich commented on June 27, 2024

for the high-spin cases (i.e. max Sz for that multiplicity), you should see:

fci   pt2
0.75  1
2     2
3.75  3
6     4
8.75  5

from qp2.

tbhuber avatar tbhuber commented on June 27, 2024

Thank you gentlemen. I appreciate the time and effort you have invested in investigating/resolving the issue.

from qp2.

kgasperich avatar kgasperich commented on June 27, 2024

@scemama
One way to make everything consistent would be to add S_z2_Sz in diag_S_mat_elem
so line 28 would be diag_S_mat_elem = dble(nup) + S_z2_Sz.

It might make the function a bit heavier (I think it will add some if(.not.s_z2_sz_is_built) ...), but if this is a problem then we could pass the S_z2_Sz as an additional argument.
This might be easier than remembering that diag_S_mat_elem actually returns <S^2> - S_z*(S_z-1) and applying the shift anywhere it is used.

If we make this change, we should also remove the shift in u_0_S2_u_0, davidson_diag_hjj_sjj (1) and (2), and the provider for CI_s2.

from qp2.

scemama avatar scemama commented on June 27, 2024

OK. Maybe the best would be to remove the variable S_z2_Sz and to compute it directly in the diagonal elements of S^2. I will do it when I come back from vacation.
Thanks!

from qp2.

TApplencourt avatar TApplencourt commented on June 27, 2024

It's should be fixed after merging #127.
Can you try to git pull and see if it fixed your problem @tbhuber ?
Thanks!

from qp2.

tbhuber avatar tbhuber commented on June 27, 2024

@TApplencourt Unfortunately, I have qp2 installed on a cluster owned by a university and do not have privilege to git pull. They do not support using head versions, but I am currently seeking a work-a-round.

from qp2.

kgasperich avatar kgasperich commented on June 27, 2024

you could try wget https://github.com/QuantumPackage/qp2/archive/dev.zip

from qp2.

Related Issues (20)

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.