Skip to content

Conversation

@ZongYongyue
Copy link

No description provided.

Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!

If possible, can you also add some docstrings and add these functions to the documentation, as well as the exported symbols list? That way, it becomes easier to use, and it's more easy to discover the new functions


function S_e_exchange(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep})
S = S_e(elt, U1Irrep, SU2Irrep)
@planar SS[-1 -2; -3 -4] := S[-1;-3 1]*permute(S',((2,1),(3,)))[1 -2; -4]
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused by the explicit call to permute here. Is this not the same as (S')[-2 1; -4] ?
Alternatively, I think if you want you can make this the same system as for the other "one-sided" operators:

The S_e gets a keyword argument side=:L or side=:R, and then you can make use of the contract_twosite function to combine them?

Copy link
Author

Choose a reason for hiding this comment

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

Ok, no problem

@codecov
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 32 lines in your changes missing coverage. Please review.

Files Patch % Lines
src/operators/fermionoperators.jl 0.00% 32 Missing ⚠️
Files Coverage Δ
src/MPSKitModels.jl 100.00% <ø> (ø)
src/operators/fermionoperators.jl 60.27% <0.00%> (-16.92%) ⬇️

@lkdvos
Copy link
Member

lkdvos commented Aug 7, 2024

Do you happen to also have some way to include some tests? Maybe some properties that these operators have to fulfill, or an (easy) model for which you can compute the groundstate energy?
Also, you should be able to autoformat to make the FormatCheck test pass, this is achieved by

using JuliaFormatter
format("MPSKitModels/src")

@ZongYongyue
Copy link
Author

Sure, it's what I'm supposed to do, but I've got some other things going on lately, and it might take a few weeks before I get around to doing this.

@lkdvos
Copy link
Member

lkdvos commented Aug 7, 2024

No worries, thanks for the effort already! I might find some time next week as well to check if I can do something more. Can you maybe tell me in what kind of context these operators appear?

@ZongYongyue
Copy link
Author

Of course! Indeed, it is a little subtle to test this operators because the total spin operator Sₑ can not be split into isolated S+, S- and Sz operators under the U1 and SU2 symmetries that makes the same test in the spinoperators.jl impossible. At the same time, it is not sufficient to verify spin operator Sₑ using the same methods as verifying electron operators e_plus, e_min in fermionoperators.jl. My idea is to use exact diagonalization that benchmarks the expectation value of these operators in a real model. As we all know, In the large $U$ limit, the Hubbard model is approximate to Heisenberg model, thus, we can consider the changes of spin-spin correlation $\sum_{ij}\langle S_i \cdot S_j\rangle$ in the process of the increase of $U$, where this correlation plays the role of order parameter. It's expected to start at zero and increase as U increases.
So we can calculate the spin-spin correlation in the Hubbard model with fixed $U$ in a finite-size system, and compare the result with the exact diagonalization one. I will definitely give a test for it, but probably in a few weeks, so if you have time to do it first or you have an another better method to deal with this, I would be very grateful.

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.

2 participants