-
Notifications
You must be signed in to change notification settings - Fork 16
Impurity HOTRG #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
VictorVanthilt
merged 31 commits into
QuantumKitHub:master
from
Adwait-Naravane:Impurity-HOTRG
Oct 17, 2025
Merged
Impurity HOTRG #105
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
c9db5fa
Add Impurity tensors for Ising and Potts
Adwait-Naravane c612903
Add single Impurity HOTRG scheme till second order"
Adwait-Naravane cb609fe
Add Finalize for Impurity HOTRG
Adwait-Naravane 7b49d31
Add test for Impurity HOTRG
Adwait-Naravane be93277
Add Impurity HOTRG to the main file
Adwait-Naravane ad4d722
Change cft rtol for LoopTNR
Adwait-Naravane 53da430
Format
Adwait-Naravane ee63d2c
Update src/schemes/impurityhotrg.jl
Adwait-Naravane a08b42a
Add docstring to the new models
Adwait-Naravane c288000
Impurity HOTRG evolution according to new convention
Adwait-Naravane be75f84
Add test for Ising magnetisation value
Adwait-Naravane c223d95
Rewrite the proector and hotrg evolution functions for Impurity HOTRG
Adwait-Naravane b6cf7f8
Resolve conflicts
Adwait-Naravane 34c5e34
Format
Adwait-Naravane 21b1e82
Add new definition for hotrg step in HOTRG code
Adwait-Naravane fd34329
Correct the RG step code for Impurity HOTRG
Adwait-Naravane 5390841
Format
Adwait-Naravane e3858dd
Merge branch 'master' into Impurity-HOTRG
VictorVanthilt 9723f7c
formatting ising_magnetisation
VictorVanthilt ea09736
Rename and use Float64
VictorVanthilt fc5dc30
update testing
VictorVanthilt 90e9f32
remove double definition of HOTRG projectors, small formatting changes
VictorVanthilt 6395658
export classical_ising_magnetisation
VictorVanthilt 06a6133
fix docs references
VictorVanthilt 70f3b09
fix docs references part 2
VictorVanthilt 54da895
small potts formatting
VictorVanthilt 788754f
add info about initial size of lattice with classical_ising_impurity
VictorVanthilt 170fab0
change `classical_ising` to have an initial lattice size of 1, in lin…
VictorVanthilt ad098a3
remove reference to initial size of 2
VictorVanthilt 205a685
update `ImpurityHOTRG` tests
VictorVanthilt b3bc4c6
update model tests
VictorVanthilt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| """ | ||
| $(TYPEDEF) | ||
|
|
||
| Single impurity method for Higher-Order Tensor Renormalization Group (for 2nd order) | ||
|
|
||
| ### Constructors | ||
| $(FUNCTIONNAME)(T, T_imp_order1_1, T_imp_order1_2, T_imp_order2 [, finalize=finalize!]) | ||
|
|
||
| ### Running the algorithm | ||
| run!(::ImpurityHOTRG, trunc::TensorKit.TruncationSheme, stop::Stopcrit[, finalize_beginning=true, verbosity=1]) | ||
|
|
||
| Each step rescales the lattice by a (linear) factor of 2 | ||
|
|
||
| !!! info "verbosity levels" | ||
| - 0: No output | ||
| - 1: Print information at start and end of the algorithm | ||
| - 2: Print information at each step | ||
|
|
||
| ### Fields | ||
|
|
||
| $(TYPEDFIELDS) | ||
|
|
||
| ### References | ||
| * [Morita et al 10.1016/j.cpc.2018.10.014 (2018)](@cite moritaCalculationHigherorderMoments2019) | ||
|
|
||
| """ | ||
|
|
||
| mutable struct ImpurityHOTRG <: TNRScheme | ||
| T::TensorMap | ||
| T_imp_order1_1::TensorMap | ||
| T_imp_order1_2::TensorMap | ||
| T_imp_order2::TensorMap | ||
| finalize!::Function | ||
| function ImpurityHOTRG( | ||
| T::TensorMap{E, S, 2, 2}, | ||
| T_imp_order1_1::TensorMap{E, S, 2, 2}, | ||
| T_imp_order1_2::TensorMap{E, S, 2, 2}, | ||
| T_imp_order2::TensorMap{E, S, 2, 2}, | ||
| ; | ||
| finalize = (finalize!), | ||
| ) where {E, S} | ||
|
|
||
| @assert space(T, 1) == space(T_imp_order1_1, 1) == space(T_imp_order1_2, 1) "First space of T, T_imp_order1_1 and T_imp_order1_2 must be the same" | ||
| @assert space(T, 2) == space(T_imp_order1_1, 2) == space(T_imp_order1_2, 2) "Second space of T, T_imp_order1_1 and T_imp_order1_2 must be the same" | ||
| @assert space(T, 3) == space(T_imp_order1_1, 3) == space(T_imp_order1_2, 3) "Third space of T, T_imp_order1_1 and T_imp_order1_2 must be the same" | ||
| @assert space(T, 4) == space(T_imp_order1_1, 4) == space(T_imp_order1_2, 4) "Fourth space of T, T_imp_order1_1 and T_imp_order1_2 must be the same" | ||
| return new(T, T_imp_order1_1, T_imp_order1_2, T_imp_order2, finalize) | ||
| end | ||
| end | ||
|
|
||
| function step!(scheme::ImpurityHOTRG, trunc::TensorKit.TruncationScheme) | ||
| Uy, _ = _get_hotrg_yproj(scheme.T, scheme.T, trunc) | ||
|
|
||
| T = _step_hotrg_x(scheme.T, scheme.T, Uy) | ||
| T_imp_order1_1 = 0.5 * (_step_hotrg_x(scheme.T_imp_order1_1, scheme.T, Uy) + _step_hotrg_x(scheme.T, scheme.T_imp_order1_1, Uy)) | ||
| T_imp_order1_2 = 0.5 * (_step_hotrg_x(scheme.T_imp_order1_2, scheme.T, Uy) + _step_hotrg_x(scheme.T, scheme.T_imp_order1_2, Uy)) | ||
| T_imp_order2 = 0.25 * ( | ||
| _step_hotrg_x(scheme.T_imp_order2, scheme.T, Uy) + | ||
| _step_hotrg_x(scheme.T, scheme.T_imp_order2, Uy) + | ||
| _step_hotrg_x(scheme.T_imp_order1_1, scheme.T_imp_order1_2, Uy) + | ||
| _step_hotrg_x(scheme.T_imp_order1_2, scheme.T_imp_order1_1, Uy) | ||
| ) | ||
|
|
||
| scheme.T = T | ||
| scheme.T_imp_order1_1 = T_imp_order1_1 | ||
| scheme.T_imp_order1_2 = T_imp_order1_2 | ||
| scheme.T_imp_order2 = T_imp_order2 | ||
|
|
||
| Ux, _ = _get_hotrg_xproj(scheme.T, scheme.T, trunc) | ||
|
|
||
| T = _step_hotrg_y(scheme.T, scheme.T, Ux) | ||
| T_imp_order1_1 = 0.5 * (_step_hotrg_y(scheme.T_imp_order1_1, scheme.T, Ux) + _step_hotrg_y(scheme.T, scheme.T_imp_order1_1, Ux)) | ||
| T_imp_order1_2 = 0.5 * (_step_hotrg_y(scheme.T_imp_order1_2, scheme.T, Ux) + _step_hotrg_y(scheme.T, scheme.T_imp_order1_2, Ux)) | ||
| T_imp_order2 = 0.25 * ( | ||
| _step_hotrg_y(scheme.T_imp_order2, scheme.T, Ux) + | ||
| _step_hotrg_y(scheme.T, scheme.T_imp_order2, Ux) + | ||
| _step_hotrg_y(scheme.T_imp_order1_1, scheme.T_imp_order1_2, Ux) + | ||
| _step_hotrg_y(scheme.T_imp_order1_2, scheme.T_imp_order1_1, Ux) | ||
| ) | ||
|
|
||
| scheme.T = T | ||
| scheme.T_imp_order1_1 = T_imp_order1_1 | ||
| scheme.T_imp_order1_2 = T_imp_order1_2 | ||
| scheme.T_imp_order2 = T_imp_order2 | ||
|
|
||
| return scheme | ||
| end | ||
|
|
||
| function Base.show(io::IO, scheme::ImpurityHOTRG) | ||
| println(io, "ImpurityHOTRG - Impurity Higher Order TRG") | ||
| println(io, " * T: $(summary(scheme.T))") | ||
| println(io, " * T_imp_order1_1: $(summary(scheme.T_imp_order1_1))") | ||
| println(io, " * T_imp_order1_2: $(summary(scheme.T_imp_order1_2))") | ||
| println(io, " * T_imp_order2: $(summary(scheme.T_imp_order2))") | ||
| return nothing | ||
| end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.