Giter Site home page Giter Site logo

abeliantensors's People

Contributors

mhauru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

abeliantensors's Issues

Evenly keep eigenvalues among different sector for abeliantensor

Hi Markus, the current matrix_eig method in abeliantensor.py keep the first several largest eigenvalues among all eigenvalues. For example, if we truncate a leg with bound dimension 30 to 20 for Z2 symmetric tensor, and let's say the initial shape is [15,15], the truncation could end up like [9,11]. However, sometimes, we may wish the truncation is evenly distributed among two sectors to be [10,10], so is it possible to support this "evenly truncation feature" for the eigenvalue decomposition for the abeliantensor?

I think the key is in line 1978 of the abeliantensor.py in matrix_eig method

 # Figure out what bond dimension to truncate to, how this bond
 # dimension is distributed over the different sectors, and what the
 # truncation error is.
        chi, dims, rel_err = type(self)._find_trunc_dim(
            all_eigs,
            eigdecomps,
            minusabs_next_eigs,
            dims,
            chis=chis,
            eps=eps,
            break_degenerate=break_degenerate,
            degeneracy_eps=degeneracy_eps,
            trunc_err_func=trunc_err_func,
            norm_sq=norm_sq,
        )

Current what I do is to add something like this after, just design for Z2-symmetric tensors

if evenTrunc:
            # This piece of codes is only designed
            # with Z2 symmetry tensor in mind
            errmeg = "The matrix should have two sectors (0,0) and (1,1)."
            assert len(dims) == 2, errmeg
            if chiSpec % 2 == 0:
                dims[(0, 0)] = int(chiSpec / 2)
                dims[(1, 1)] = int(chiSpec / 2)
            else:
                dims[(0, 0)] = int((chiSpec + 1) / 2)
                dims[(1, 1)] = int((chiSpec - 1) / 2)

where evenTrunc is a boolean variable specifying whether we want to evenly truncate among sectors or not. However, I think there must be a better way to do it.

Xinliang

The unitary condition of SVD of an U1 symmetric tensor can not be satisfied

Dear Markus,
I try to exploit your package to do a SVD for an U1 symmetric real tensor A = USV. However, I found that U*U^T wasn't identity. Please help me to solve this issue, thanks!
My test code is attached as follows:
D = 10
T0 = np.random.rand(D,D)
T0 = (T0 + T0.T)/2.

d0 = int(D/3)
d1 = int((D-d0)/2)
dimv = [d1,d0,d1]
qimv = [-1,0,1]
dims = tuple([dimv]*2)
qims = tuple([qimv]*2)
dirs = [1,-1]
A = TensorU1.from_ndarray(T0, shape=dims, qhape=qims, dirs=dirs)

U, S, V = A.svd([0], [1])
#S, U = A.eig([0], [1])

U1 = np.transpose(U, [1,0])
print( 'U.dot(U1)= ', U.dot(U1.flip_dir(0),([1], [0])) )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.