Replies: 2 comments 2 replies
-
Hi. Your intuition is right. The gradient and expectation value of Squared[A] is much cheaper than computing the expectation value or gradient of A\dagger A. you’re also right that when you are using the VMC driver, at least by default, the driver will collect the square into A\dagger A, and effectively won’t be using this trick. the reason for this is the following:
Overall, we found that sometimes usrrs where using the squared estimator without realizing it, and ending with optimizations that did not convege well, and that’s why we introduced the .collect call. uou can still circumevent this by manually setting driver._ham to the squared operator after you construct the driver |
Beta Was this translation helpful? Give feedback.
-
It’s just a name, and maybe not a terribly good one. |
Beta Was this translation helpful? Give feedback.
-
I am currently working with a Hamiltonian$H = A^\dagger A$ and very conveniently, the $A^\dagger A$ , especially when taking the expectation value as it has its own local estimator which is the square of the estimator of $A$ (if I understand correctly, since it calls the $A$ ).
Squared
lazy wrapper helps me avoid actually computing.get_conn_padded()
of the parent here to get the arguments and the estimator here is just the absolute value squared of the estimator ofHowever, when trying to now minimise$H$ , the VMC driver first collects a concrete instance of this lazy operator (as shown here using $A^\dagger A$ explicitly, which can be computationally expensive if $A$ has a ton of operators in it...
.collect()
). This will then actually computeLastly, when computing$A$ ) is Hermitian or not.
.expect_and_grad()
, it computes it using the non-Hermitian implementation (if I understand correctly), irrespective if whether the wrapper operator (in this caseWhat I'm trying to understand are two things:
Squared
operator to use the non-Hermitian gradient function, irrespective of the wrapped operator?Sorry of these are trivial/obvious questions! Just trying to understand some things a little better.
Appreciate any help!
Beta Was this translation helpful? Give feedback.
All reactions