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

"MPS is not normalized" when I try to PastaQ.getsamples(ψ, bases) #310

Open
Mi-Peng opened this issue May 15, 2024 · 2 comments
Open

"MPS is not normalized" when I try to PastaQ.getsamples(ψ, bases) #310

Mi-Peng opened this issue May 15, 2024 · 2 comments

Comments

@Mi-Peng
Copy link

Mi-Peng commented May 15, 2024

I got an error that "MPS is not normalized, norm=1.000000042243257" when I tried to PastaQ.getsamples(ψ, bases). I understand that the MPS norm should be 1, but I'm curious about the reason why the norm is not 1. Does the approximation of floating point numbers cause it, or is there something wrong with my code? In addition, the norm obtained by running my code is usually 1e-8 orders of magnitude different from 1. Could this error be larger? Thanks very much.

@mtfishman
Copy link
Collaborator

Probably the check is too strict. Can you try normalizing your MPS explicitly?

@Mi-Peng
Copy link
Author

Mi-Peng commented May 15, 2024

Probably the check is too strict. Can you try normalizing your MPS explicitly?

Thanks for your reply. I fix it by dividing by its norm,i.e., ψ=ψ / LinearAlgebra.norm(ψ), and then it doesn't raise any error. I'm not sure about the meaning of the check is too strict, since I didn't find something like eps in the docs. Actually, I'm curious about the reason and I can accept the current error, 1e-8, but I'm worried that this error could get larger in some extreme cases.

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