Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ITensor/ITensors.jl into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Jul 6, 2022
2 parents b66d1b7 + f772def commit 5b4ad1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/Observer.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ which include:
- psi: the current wavefunction MPS
- bond: the bond `b` that was just optimized, corresponding to sites `(b,b+1)` in the two-site DMRG algorihtm
- sweep: the current sweep number
- sweep_is_done: true if at the end of the current sweep, otherwise false
- sweep\_is\_done: true if at the end of the current sweep, otherwise false
- half_sweep: the half-sweep number, equal to 1 for a left-to-right, first half sweep, or 2 for the second, right-to-left half sweep
- spec: the Spectrum object returned from factorizing the local superblock wavefunction tensor in two-site DMRG
- outputlevel: an integer specifying the amount of output to show
Expand Down
8 changes: 4 additions & 4 deletions src/ITensorChainRules/mps/abstractmps.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function rrule(::typeof(MPS), x::Vector{<:ITensor}; kwargs...)
y = MPS(x; kwargs...)
function MPS_pullback(ȳ)
function rrule(::Type{T}, x::Vector{<:ITensor}; kwargs...) where {T<:Union{MPS,MPO}}
y = T(x; kwargs...)
function T_pullback(ȳ)
ȳtensors =.data
n = length(ȳtensors)
envL = [ȳtensors[1] * dag(x[1])]
Expand All @@ -18,7 +18,7 @@ function rrule(::typeof(MPS), x::Vector{<:ITensor}; kwargs...)
push!(x̄, envL[n - 1] * ȳtensors[n])
return (NoTangent(), x̄)
end
return y, MPS_pullback
return y, T_pullback
end

function rrule(::typeof(inner), x1::T, x2::T; kwargs...) where {T<:Union{MPS,MPO}}
Expand Down

0 comments on commit 5b4ad1b

Please sign in to comment.