-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix bug making TaskBasedCpuContractor different from TensorNetwork #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on finding this! All looks good on tests to me.
Though, I think we should create a separate task to contract a network (provided we are fine storing data in the repo), and compare the existing methods. This will also be useful with the GPU work coming down the line.
Just ran some comparisons on the same network against cotengra, and getting different contraction results with the same data and path. Is it possible to confirm the output from the changes here are commensurate with other packages? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
That said, I don't quite understand how the ordering of two contracted nodes causes a discrepancy between the output of TensorNetwork::Contract()
and TaskBasedCpuContractor::Contract()
. Doesn't removing the swap just permute the indices of the node given by the contraction of two nodes? How does this change influence the value of an output scalar?
I've pushed a change to the GEMV binding which fixes a problem with the following contraction: Tensor lhs({"i"}, {2}, {0, 1});
Tensor rhs({"i", "j"}, {2, 3}, {0, 1, 2, 3, 4, 5});
Tensor con = ContractTensors(lhs, rhs); // Before: {1, 4, 0}, Now: {3, 4, 5} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New changes look good to me! Nice work.
Thanks Mikhail and Lee! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Context:
We removed the swap from PathInfo but apparently we forgot to remove the node swap from TensorNetwork.hpp, this will definitely cause TaskBasedCpuContractor and TensorNetwork to get different results. Now they get the same result.
Description of the Change:
Benefits:
Possible Drawbacks:
Nothing
Related GitHub Issues:
None