Closed JoeyT1994 closed 5 months ago
Attention: Patch coverage is 65.51724%
with 10 lines
in your changes are missing coverage. Please review.
Project coverage is 82.66%. Comparing base (
ae4ad2c
) to head (0dc6016
). Report is 4 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
src/apply.jl | 52.38% | 10 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I have to say that it doesn't sit well with me to use an SVD to perform square roots and inverses of positive semi-definite Hermitian matrices, I think it is safer and more direct (not to mention faster) to use a Hermitian eigendecomposition to ensure the gauge is fixed in the correct way.
Looks good, thanks! Good to go back and start cleaning up some of this code.
This PR removes the
sqrt_inv_sqrt
function inapply.jl
in favor of amap_itensor(f::Function, t::ITensors, args...)
added in the fileitensorsextensions.jl
in the new internal moduleITensorsExtensions
(wheresrc/ITensorsExt/utils.jl
is also now moved).map_itensor(f::Function, A::ITensor, ...)
uses the SVD to take a decompositionU, S, V
ofA
and appliesf
over the diagonal elements ofS
. This uses thesqrt_decomp
function fromITensors.jl
(introduced in the PR https://github.com/ITensor/ITensors.jl/pull/1197/files) which correctly handles quantum numbers. The indices of the returnedITensor
match those of the inputA
.The
symmetric_factorize
function has been removed entirely fromapply.jl
as we can just callfactorize_svd(A::ITensor; ortho = "none") from
ITensors.jl` to do the same thing (again this was introduced in PR https://github.com/ITensor/ITensors.jl/pull/1197/files).Tests are included. @mtfishman these appear to show the square root / inverse being correctly taken by the SVD backend and I don't see any phase issues cropping up?
A few other changes in this PR:
src/tensornetworkoperators.jl
andtest/test_tnos.jl
have been removed and archived as they will be significantly refactored down the line.