Beginner question: `wfn_return` gives same wfn for scf and mp2 calculation

Dear Developers,

Here is the simple test to show the problem:

numpy_memory = 2

mol = psi4.geometry("""
units au
H 1.43 1.1 0.0
H -1.43 1.1 0.0
O 0.0 0.0 0.0
symmetry c1

psi4.set_options({‘basis’: ‘sto-3g’,
‘scf_type’: ‘pk’,
‘mp2_type’: ‘conv’,
‘freeze_core’: ‘false’,
‘e_convergence’: 1e-10,
‘d_convergence’: 1e-10})

mp2_e, wfn =‘mp2’, return_wfn=True)
scf_e, wfn2 =‘scf’, return_wfn=True)
print(wfn.Ca().to_array() -wfn2.Ca().to_array() )

The code gives result of energy: mp2: -74.99768128064485 and scf -74.96244164903169 which are correct. But wavefunctions returned for both methods are the same, how so?

Your example shows that the orbitals are the same, not that the wavefunction objects are the same. Different wavefunction objects can have the same orbitals. And of course, wavefunction objects in Psi aren’t exactly the same thing as mathematical wavefunctions.

If you want more of an explanation than that, can you explain why you expected their orbitals to be the same? If this is a small part of a bigger problem, e.g., you’re trying to debug some larger computation, please explain that as well. Otherwise, I may wind up rambling about something irrelevant to you.

1 Like

Thanks! Yes, actually I need psi4 result for a larger project.

In short, I want to know if I can use MP2 as reference for CCSD, such that e^T |HF> replaced by e^T |MP2>. And in order to test it, I will need:

  1. How to get second quantized Hamiltonian of a given (example water) molecule in MP2 level. Mathematically I think they are just <p|T + V|q> and <pq| 1/r |pqrs> in MP2 basis. That’s the reason why I want to get the wavefunction and post this question.

  2. Based on MP2, I was supposed to get the initial guess of CCSD and also according to those amplitude I can truncate double excitation terms at desire. I found expression of those amplitude using psi4 here at line 236. So my question is are t2 indices indicates t^{ab}_{ij} * a^ b^ i j term with t^{ab}_{ij} as the value of t2[a,b,i,j]?

1a. The second quantized Hamiltonian is a linear operator. It doesn’t care what state it acts on, just the one-particle basis. Now, if you want the “normal ordered Hamiltonian”, that will depend on your choice of reference.
1b. You need to think very carefully about what you want |MP2> to mean. There may be a second-order wavefunction, but you don’t get the second-order energy by taking the expectation value of that second-order wavefunction. Two orders in the bra plus two in the ket plus one in the fluctuation potential gives a quantity with up to five orders. If you don’t have a second order wavefunction, the next best thing is normally to take the reduced density matrices. However, it isn’t obvious to me what it would mean to use reduced density matrices as a reference for CCSD.
1c. Do you want to use MP2 to guess a set of “better” orbitals for a conventional (although not canonical) CCSD computation? In that case, the things you want are called the natural orbitals of the MP2 reduced density matrices. If this is what you’re looking for, do you want help pulling those from Psi, do you want to be able to compute those yourself, or both?

2a. Some of your sentences become garbled here. “is are t2 indices”? “truncate double excitation terms at desire”? I don’t understand what you mean.
2b. Yes, line 236 constructs the initial guess for the t2 amplitudes that appear in the cluster operator.
2c. Your indices aren’t quite correct. You excite from occupied orbitals to virtual orbitals, so you want t^ij_ab a^ b^ j i. Note that the annihilation of i must come before the annihilation of j.

Thanks for your kindly reply!

1a. Sorry I don’t know much of the normal ordered Hamiltonian, but I suppose that is not what I’m looking for. The expression I’m using is eqn(2) in paper, which contains integral using spin orbitals. So I thought the coefficients might change depending on the wavefunction I have.

1b. See the below descriptions about what I mean as using MP2 as reference state.

1c. I know I can use MP2 result to get a reasonable initial guess to CC coefficients. And can probably truncate number of double excitations based on t^ij_ab. So I do want to know what are significant double excitation terms and what their initial values should be using PSI4. And additional question is if I can simply choose first few significant double excitation terms as truncation.

2a. Sorry for the confusion. For clarity, there should have a comma between is and `are. Basically I was just asking how to pull out the significant double excitation determinants and its coefficient.

2b. Thanks!

2c. Sorry, I got sloppy there. I corrected indices in my originally post.

Ok. At this stage, I feel it is necessary to describe what I’m actually up to. I’m trying to simulate quantum chemistry using quantum computer using VQE (variational eigensolver) algorithm. So I want PSI4 to be part of the tool chain of some quantum computing process.

I don’t know if you are familiar with VQE, but actually it is just using quantum computer to simulate UCCSD with e^{T-T*}|ref>, where T = T1 + T2 and in second quantized form with coefficients to be optimized. See paper here.

This is what I want from PSI4:

  1. A Hamiltonian in second quantized state in eqn(2) whose coefficients are given in eqn(3) and eqn(4)
  2. A reference state that in second quantized form that can be populated as using 1^ 2^ 3^... |vac> in eqn(28)
  3. Being able to truncate T2 term and being able to initialize T terms with MP2 amplitudes .

So I know how to do this using |HF>, as it naturally satisfies eqn(28). My question is, can I use |MP2> as similar product state and the reference state of UCCSD?

I’m not familiar with VQE or quantum computing, but I know UCCSD.

1a. The coefficients for Eq. 2 depend on the choice of molecular orbitals, but any choice will produce the same result after you perform your summation, as long as they’re all orthonormal. This is the “orbital invariance” property. In the classical computing that I’m familiar with, you need to evaluate operator products of H with your cluster operator using Wick’s theorem. Because of that, it is extremely convenient to choose your molecular orbitals to be the same as the occupied and virtual orbitals you use to define your cluster operator.

The Psi4Numpy tutorials should tell you how to obtain those coefficients/integrals.

For your list of what you want from Psi4…

  1. Satisfying item (2) with an MP2 state is impossible. That a state satisfies Eq. 28 is a very restrictive condition. MP2 deliberately breaks that.
1 Like