Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should raise error if nvals > ndim #47

Open
qiyang-ustc opened this issue Nov 26, 2024 · 2 comments
Open

should raise error if nvals > ndim #47

qiyang-ustc opened this issue Nov 26, 2024 · 2 comments

Comments

@qiyang-ustc
Copy link

qiyang-ustc commented Nov 26, 2024

julia> U2,S2,V2=tsvd(A)
([-0.6544776144364567; -0.2676920846823157; -0.26769208468231576; -0.6544776144364568;;], [2.853906087544359], [-0.6544776144364567; -0.2676920846823159; -0.2676920846823158; -0.6544776144364568;;])

julia> S2
1-element Vector{Float64}:
 2.853906087544359

julia> U2,S2,V2=tsvd(A,Dcut)
([0.654477614436457 0.6544776144364569  -0.49252301879505456 -0.19490429776098736; 0.2676920846823159 0.2676920846823158  0.0845812528300824 0.9612271076541434; 0.267692084682316 0.26769208468231587  0.013783293964742562 -0.008187951147854398; 0.6544776144364569 0.6544776144364569  0.8660699539450618 -0.19490438329188542], [2.8539060875443587, 2.8539060875443587, 2.8539060875443587, 2.8539060875443587, 2.0358732663215466, 2.035873266321546, 2.035873266321546, 2.0358732663215457, 7.108766756901759e-17, 3.2358193537960736e-17, 1.4179287268498347e-28, 3.2170949177493824e-32, 5.810616027417892e-33, 1.6873455521628154e-47, 4.0399669801870604e-53, 6.421440610886164e-63], [0.6544776144364571 0.6544776144364569  -0.2491734053545246 0.0978243652967914; 0.2676920846823158 0.26769208468231587  0.350771410883203 -0.8973344438061487; 0.26769208468231587 0.2676920846823158  0.8676315621246694 0.41899488211487207; 0.6544776144364568 0.6544776144364568  -0.24917340535492025 0.097824365300088])

julia> S2
16-element Vector{Float64}:
 2.8539060875443587
 2.8539060875443587
 2.8539060875443587
 2.8539060875443587
 2.0358732663215466
 2.035873266321546
 2.035873266321546
 2.0358732663215457
 7.108766756901759e-17
 3.2358193537960736e-17
 1.4179287268498347e-28
 3.2170949177493824e-32
 5.810616027417892e-33
 1.6873455521628154e-47
 4.0399669801870604e-53
 6.421440610886164e-63
@andreasnoack
Copy link
Member

Indeed. Would you be able to prepare a PR?

@qiyang-ustc
Copy link
Author

I am not good at Julia, I am not sure if I can make it correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants