-
Notifications
You must be signed in to change notification settings - Fork 41
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
Progress towards a version 1 #135
Conversation
…}` (#1) * Add scalartype parameter to `AbstractTensorMap` * Add scalartype in definition of TensorMap * Add scalartype to AdjointTensorMap * Add scalartype to BraidingTensor * Implement changes for indexmanipulations * Implement scalartype for linalg * implement changes for tensoroperations * implement changes for planaroperations * implement changes for ChainRules * small fixes * Fix typo * Fix missing change * Formatter * Apply scalartype changes to tests * Fix some ambiguities * De-specialize `trace_permute` * Despecialize `_contract!` * Remove unused type-parameter * Despecialize `planaradd!` and `planartrace!` * Small fixes * Change braidingtensor syntax to resolve ambiguities * despecialize some linalg methods * formatter * Add changelog entry * Fix ambiguity on Julia1.6
This changes the behaviour of copy as an instantiator for creating a TensorMap from a BraidingTensor. The rationale is that while this does sometimes happen in Julia Base, this is always in the context of lazy wrapper types, for which it makes sense to not copy the parent and then create a new wrapper. BraidingTensor does not wrap anything, so this definition makes less sense.
* Split Sectors module * convert submodule into its own module * Organize tests * Add precompile statements * Add non-unicode alternative `fusionproduct` for `⊗` * Add `directproduct` for `×` * split "trivial.jl" * Formatter * Change unicode alternatives to `otimes` and `times` Incorporate changes from #aada0b2 * Update some testset descriptions * Resolve method ambiguities * Change some formatting * Import local version of `TensorKitSectors` * Enable TensorKitSectors github action * Switch to local include for CI * Remove `NewSU2Sector` tests from main package * Refactor sectors to group Fsymbol and Rsymbol operations * Update CI Sectors to only trigger when files are changed in that path
* copy entire template and stop using copy(b.V1), copy(b.V2) as they do not work * formatting
- Refactored `TensorMap` constructors to be in line with `Array` counterparts: ```julia TensorMap{E}(undef, codomain, domain) # + some variants ``` - Added support for `zeros`, `ones`, `rand`, and `randn`. - Streamlined the interface for these functions, along with `isomorphism`, `unitary` and `isometry` into the form: ```julia function([T], codomain, domain) # + some variants ```
e47ce79
to
61ddbe8
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #135 +/- ##
==========================================
- Coverage 82.59% 79.94% -2.65%
==========================================
Files 48 42 -6
Lines 5706 4962 -744
==========================================
- Hits 4713 3967 -746
- Misses 993 995 +2 ☔ View full report in Codecov by Sentry. |
* Update TensorOperations v5 compatibility * Manually add unreleased TensorOperations version * Update CI.yml * Revert tensoroperations v5 attempts * Changes to incorporate v5 * Remove manual installation of TensorOperations in docs CI [no ci]
@assert conjA == :(:N) "conj flag should be `:N` ($conjA)" | ||
return Expr(ex.head, GlobalRef(TensorKit, Symbol(:_planartrace!)), | ||
@assert !conjA "conj flag should be disabled" | ||
return Expr(ex.head, GlobalRef(TensorKit, Symbol(:planartrace!)), | ||
map(_insert_planar_operations, ex.args[2:end])...) | ||
elseif ex.args[1] in TensorOperations.tensoroperationsfunctions |
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.
I am confused by this. Why do tensoradd!
& friends are already of the GlobalRef
form (i.e. we check ex.args[1] == GlobalRef(TensorOperations, :tensoradd!)
but would the other functions in tensoroperationsfunction
not yet have the GlobalRef
asssignment, and need to have it inserted by this postprocessor? It's old code, so it's probably a question to myself 😄 .
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.
The other functions in tensoroperations
do already have this, except for the ones that get added by different postprocessors (eg free_temporaries
). In principle, the postprocessor that adds the GlobalRef
s should just come last, but it is already part of the TensorParser()
call so it's a bit inelegant 🙃
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.
Oh right, I see, postprocessor steps that the planar parser adds after the addtensoroperations
postprocessor that is by default present in TensorParser
.
else | ||
return ex | ||
end | ||
""" |
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.
These are not yet used currently? This is in preparation of further changes to the planar parser?
function TensorMap(dataorf, T::Type{<:Number}, P::TensorMapSpace{S}) where {S<:IndexSpace} | ||
return TensorMap(dataorf, T, codomain(P), domain(P)) | ||
end | ||
for randfun in (:rand, :randn, :randexp) |
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.
randhaar
/randisometry
is lost in this process, but that one is anyway slightly different, since it needs to be interpreted at the level of whole blocks rather than elementswise, and as such is also harder to be applied in place.
No description provided.