Skip to content

can now add any number of additional svds after truncbelow#39

Merged
Jutho merged 2 commits intoQuantumKitHub:masterfrom
Gertian:master
Jul 1, 2020
Merged

can now add any number of additional svds after truncbelow#39
Jutho merged 2 commits intoQuantumKitHub:masterfrom
Gertian:master

Conversation

@Gertian
Copy link
Copy Markdown
Contributor

@Gertian Gertian commented Jun 30, 2020

This pull request should be the right one :) !

Comment thread src/tensors/truncation.jl Outdated
Comment thread src/tensors/truncation.jl Outdated
end
trunc.addone && (truncdim[findmax(next_val)[2]]+=1)
for i in 1:trunc.add_back
key_max = findmax(next_val)[2]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this? Is this not looking for the maximum of a bunch of vectors, which I think is not defined?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also argmax as alternative to the second argument of findmax

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I tested this.
Also expected it to fail but turns out that it it searching for the vector that contains the largest element.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it indeed searches for the one which is largest according to a semantic order. So this works because the singular values are sorted in descending order. Nice. That makes it very easy indeed.

Comment thread src/tensors/truncation.jl
@Gertian
Copy link
Copy Markdown
Contributor Author

Gertian commented Jul 1, 2020

I pushed your suggestions.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Jul 1, 2020

I'll merge once CI has finished.

@Jutho Jutho merged commit 3a996c9 into QuantumKitHub:master Jul 1, 2020
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

Successfully merging this pull request may close these issues.

2 participants