Skip to content

Commit

Permalink
cft_brtrg_implemented (#18)
Browse files Browse the repository at this point in the history
* cft_brtrg_implemented

* hello

* aaa

* aaa

* remove ipynb checkpoint and add it to gitignore

---------

Co-authored-by: victor <[email protected]>
  • Loading branch information
dartsushi and VictorVanthilt authored Feb 12, 2025
1 parent a9b25ac commit 591cccf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Manifest.toml
.ipynb_checkpoints
.vscode
32 changes: 30 additions & 2 deletions src/utility/cft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,36 @@ function cft_data(scheme::TNRScheme; v=1, unitcell=1)
return unitcell * (1 / (2π * v)) * log.(data[1] ./ data)
end

function cft_data(scheme::BTRG; v=1, unitcell=1)
throw(NotImplementedError("BTRG requires extra care with the environment tensors, this method will be implemented later"))
function cft_data(scheme::BTRG; v=1, unitcell=1, is_real=true)
# make the indices
indices = [[i, -i, i + 1, -(i + unitcell)] for i in 1:unitcell]
indices[end][3] = 1

@tensor T_unit[-1 -2; -3 -4] := scheme.T[1 2; -3 -4] * scheme.S1[-2; 2] *
scheme.S2[-1; 1]
T = ncon(fill(T_unit, unitcell), indices)

outinds = Tuple(collect(1:unitcell))
ininds = Tuple(collect((unitcell + 1):(2unitcell)))

T = permute(T, outinds, ininds)
D, _ = eig(T)

data = zeros(ComplexF64, dim(space(D, 1)))

i = 1
for (_, b) in blocks(D)
for I in LinearAlgebra.diagind(b)
data[i] = b[I]
i += 1
end
end
data = filter(x -> real(x) > 0, data)
data = sort(data; by=x -> real(x), rev=true)
if is_real
data = real(data)
end
return unitcell * (1 / (2π * v)) * log.(data[1] ./ data)
end

function central_charge(scheme::TNRScheme, trunc::TensorKit.TruncationScheme,
Expand Down

0 comments on commit 591cccf

Please sign in to comment.