Page 1 of 1

Asking about how to calculate expectation values after TDVP evolution

Posted: 02 Nov 2022, 01:53
by YongtaoZhan
Hi,

I want to calculate the expectation value of Sx, Sy and Sz after TDVP evolution. I use psi.expectation_value('Sx'),psi.expectation_value('Sy'),psi.expectation_value('Sz') to do the calculation but it appears error information:

ValueError: <Site, d=2, ops={'Sz', 'Id', 'Sp', 'Sm', 'JW'}> doesn't have the operator 'Sx'

It only allows me to calculate the expectation value of above five operators. May I know what should I do to calculate psi.expectation_value('Sx') and psi.expectation_value('Sy') ?

The state psi is initialized as product states and then goes through TDVP evolution:
Model_XXZ = XXZChain(model_params)
psi = MPS.from_product_state(Model_XXZ.lat.mps_sites(), product_state, bc=Model_XXZ.lat.bc_MPS, form='B')
tdvp_params = {
'start_time': 0,
'dt': delta_t,
'trunc_params': {
'chi_max': chi,
'svd_min': 1.e-10,
'trunc_cut': None
}
}
tdvp_engine = tdvp.TDVPEngine(psi, Model_XXZ, tdvp_params)

Re: Asking about how to calculate expectation values after TDVP evolution

Posted: 04 Nov 2022, 15:42
by Johannes
The XXZ chain by default turns on Sz conservation. Hence, there is no operator 'Sx' or 'Sy', because they don't conserve the Sz charge. Due to Sz conservation, you immediately know that expectation values of Sx and Sy are zero.
See also this FAQ question

However, note that the correlations <Sx_i Sx_j> in general can be non-zero. To calculate them, decompose them with
\(S^{\pm} = S^x \pm i S^y\), i.e. e.g. \(S^x = 0.5(S^+ + S^-)\) in terms of the Sp and Sm operators,
and measure psi.correlation_function('Sp', 'Sm').

Re: Asking about how to calculate expectation values after TDVP evolution

Posted: 07 Nov 2022, 01:59
by YongtaoZhan
Hi, thanks you for your reply!

When I try to use exact diagonalization to calculate the time evolution, I find the expectation values of Sx and Sy of the final state are not zero.
Also, assume the reduced density matrix of a single site is ([a b],[c,d]), if the expectation values of Sx and Sy are zero, that means b=c=0, which I find is not true.

I don't understand why you say the expectation values of Sx and Sy are zero...could you please explain why?

Re: Asking about how to calculate expectation values after TDVP evolution

Posted: 07 Nov 2022, 10:26
by Johannes
This is really standard arguments from quantum mechanics:
You can use Sz conseration, if \( [H,S^z] = 0\), where \(S^z = \sum_i S^z_i\). In that case, you *choose* to work in fixed magnetization sectors and write an initial state with \(S^z |\psi_0\rangle = m \hbar | \psi_0 \rangle \), where \(m\in \mathbb{R}\) is a fixed number, the quantum number. Since \(H\) commutes with \(S^z\), you directly get \(S^z |\psi(t)\rangle = m \hbar | \psi(t) \rangle \), i.e. it remains an eigenstate of \(S^z\) with the same quantum number.

As I said, you can express \(S^x_i = 0.5( S^+_i + S^-_i)\) in terms of the ladder operators, for which \([S^z, S^+_i] = \hbar \).
Then standard arguments of quantum mechanics show
\[ m \hbar \langle \psi | S^+_i | \psi \rangle = \langle \psi | S^+_i S^z | \psi \rangle = \langle \psi | (S^z + \hbar) S^+_i | \psi \rangle = (m+1) \hbar \langle \psi | S^+_i | \psi \rangle, \]
so we must have \( \langle \psi | S^+_i | \psi \rangle = 0 \). Take the complex conjugate, and you see also \( \langle \psi | S^-_i | \psi \rangle = 0 \), so \( \langle \psi | S^x_i| \psi \rangle = 0.5( \langle \psi | S^+_i| \psi \rangle + \langle \psi | S^-_i| \psi \rangle ) = 0 \).

If you get non-zero expectation values in exact diagonalization (ED), either your ED didn't conserve Sz properly, or you didn't start from the same initial state (with fixed particle number). Of course, you could also choose to write an initial state like \(|\rightarrow \cdots \rangle \), which is not an eigenstate of \(S^z\). But charge conservation tells you that the problem of time evolution can be split into evolving separately within each charge sector.

Re: Asking about how to calculate expectation values after TDVP evolution

Posted: 07 Nov 2022, 19:31
by YongtaoZhan
Hi, thank you for your reply!

I did use Haar-random state as initial state rather than an eigenstate of Sz when I use exact diagnalization to calculate the time evolution, and this make the Sx and Sy non-zero. May I know how can I get the expectation value of Sx and Sy for random initial state? Thanks!

Re: Asking about how to calculate expectation values after TDVP evolution

Posted: 08 Nov 2022, 09:35
by Johannes
A Haar random state has (almost) maximal entanglement and can thus *not* be compressed into an MPS (for large system sizes without significant truncation).
If you have a given Haar random state, you could try to convert it to a np_conserved Array and then into an MPS (without charge conservation, so set conserve=None in the model!), using MPS.from_full

Re: Asking about how to calculate expectation values after TDVP evolution

Posted: 12 Nov 2022, 02:58
by YongtaoZhan
Thank you very much! I just realized I met the problem because there is Sz conservation in XXZChain. Once I set conserve to None, it works well!