Skip to content

Conversation

@Jutho
Copy link
Member

@Jutho Jutho commented Oct 10, 2024

No description provided.

Comment on lines 24 to 26
- '1.8' # lowest TensorOperations version
- '1.10' # LTS version
- '1' # automatically expands to the latest stable 1.x release of Julia
Copy link
Member

Choose a reason for hiding this comment

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

I think the recommended way is now:

- 'lts'
- '1'
- '1.8

Comment on lines 6 to 9
(N == length(pA) && TupleTools.isperm(pA)) ||
throw(ArgumentError("Invalid permutation of length $N: $pA"))
size(C) == TupleTools.getindices(size(A), pA) ||
throw(DimensionMismatch("non-matching sizes while adding arrays"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
(N == length(pA) && TupleTools.isperm(pA)) ||
throw(ArgumentError("Invalid permutation of length $N: $pA"))
size(C) == TupleTools.getindices(size(A), pA) ||
throw(DimensionMismatch("non-matching sizes while adding arrays"))
argcheck_tensoradd(C, A, pA)

Copy link
Member Author

Choose a reason for hiding this comment

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

This only works after making TensorOperations a dependency, right? Also, I currently do not yet use Index2Tuple in the arguments for these methods. I will first study your PR on top of this one.

Comment on lines 21 to 24
NC == length(p) ||
throw(ArgumentError("Invalid selection of $NC out of $NA: $p"))
NA - NC == 2 * length(q1) == 2 * length(q2) ||
throw(ArgumentError("invalid number of trace dimension"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NC == length(p) ||
throw(ArgumentError("Invalid selection of $NC out of $NA: $p"))
NA - NC == 2 * length(q1) == 2 * length(q2) ||
throw(ArgumentError("invalid number of trace dimension"))
argcheck_tensortrace(C, A, p, q)

dense_result = TensorOperations.ncon(Array.(tensors), indices, conjlist)

@test Array(sparse_result) ≈ dense_result
if SparseArrayKit.nonzero_length(sparse_result) > 0
Copy link
Member

Choose a reason for hiding this comment

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

Does this not work if the result is completely sparse?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does, but the tests take quite some time, my impression being that it is the dense tensor contraction taking most of the time. And since quite a few of the tests actually yield a zero tensor, I thought to not contract these in the dense case to save on compute time. The resulting test is still meaningful, but I would hope that the tests leading to nonzero tensors would be sufficient to check for errors.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe just a comment for future reference would be helpful then :)

* use new lts syntax

* Reabsorb TensorOperations as full dependency

* Fix Aqua compat

* Add missing Compat entries
@codecov
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.07%. Comparing base (f348d12) to head (e34f234).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #14      +/-   ##
==========================================
+ Coverage   89.88%   90.07%   +0.19%     
==========================================
  Files           8        7       -1     
  Lines         425      413      -12     
==========================================
- Hits          382      372      -10     
+ Misses         43       41       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jutho Jutho merged commit 5eee1bb into master Oct 12, 2024
@Jutho Jutho deleted the jh/v0.4 branch October 12, 2024 20:08
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