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

Progress towards a version 1 #135

Merged
merged 14 commits into from
Jul 18, 2024
Merged

Progress towards a version 1 #135

merged 14 commits into from
Jul 18, 2024

Conversation

lkdvos
Copy link
Collaborator

@lkdvos lkdvos commented Jul 15, 2024

No description provided.

lkdvos and others added 8 commits May 26, 2024 19:41
…}` (#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
```
@lkdvos lkdvos force-pushed the v1 branch 2 times, most recently from e47ce79 to 61ddbe8 Compare July 16, 2024 06:26
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 74.54128% with 111 lines in your changes missing coverage. Please review.

Project coverage is 79.94%. Comparing base (6265c35) to head (1999280).
Report is 1 commits behind head on master.

Files Patch % Lines
src/planar/planaroperations.jl 49.29% 36 Missing ⚠️
src/tensors/tensor.jl 80.00% 23 Missing ⚠️
src/tensors/braidingtensor.jl 48.38% 16 Missing ⚠️
src/tensors/abstracttensor.jl 71.42% 10 Missing ⚠️
src/tensors/indexmanipulations.jl 65.21% 8 Missing ⚠️
src/tensors/linalg.jl 70.37% 8 Missing ⚠️
src/planar/postprocessors.jl 53.84% 6 Missing ⚠️
src/tensors/adjoint.jl 60.00% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

lkdvos and others added 2 commits July 16, 2024 14:06
* 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
Copy link
Owner

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 😄 .

Copy link
Collaborator Author

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 GlobalRefs should just come last, but it is already part of the TensorParser() call so it's a bit inelegant 🙃

Copy link
Owner

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
"""
Copy link
Owner

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)
Copy link
Owner

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.

@lkdvos lkdvos marked this pull request as ready for review July 17, 2024 12:16
@lkdvos lkdvos changed the title V1 Progress towards a version 1 Jul 17, 2024
@Jutho Jutho merged commit 62597cb into Jutho:master Jul 18, 2024
11 of 13 checks passed
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.

3 participants