-
Notifications
You must be signed in to change notification settings - Fork 129
Description
Add a function [p]inv(::ITensor, Linds; kwargs...) to invert an ITensor using a Moore-Penrose pseudoinverse. We can use tolerance keyword arguments for the pseudoinverse similar to the ones used in LinearAlgebra.pinv.
A user can specify the indices to specify how the ITensor gets reshaped into a matrix, and if they aren't specified, it can use pairs of primed and unprimed indices (treating it like a square matrix from the primed to the unprimed space, like in eigen). The latter case is useful for doing non-orthogonal basis changes with gates, i.e. do a similarity transformation. This could be used in a special mode of the apply function, with an interface apply(gates, ::MPO; apply_inv = true), analogous to the current apply(gates, ::MPO; apply_dag = true) but applicable to similarity transformations of non-unitary gates.