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

Document Transformations #73

Merged
merged 15 commits into from
Jul 27, 2023
Merged

Document Transformations #73

merged 15 commits into from
Jul 27, 2023

Conversation

jofrevalles
Copy link
Member

Summary

This PR aims to enhance the documentation for the transformations.jl module, providing more detailed descriptions of each available transformation and including a visual example to demonstrate the impact of the transformations on a tensor network.

@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Merging #73 (0eba627) into master (6f21d05) will decrease coverage by 0.32%.
Report is 17 commits behind head on master.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
- Coverage   78.13%   77.82%   -0.32%     
==========================================
  Files          10        9       -1     
  Lines         709      699      -10     
==========================================
- Hits          554      544      -10     
  Misses        155      155              
Files Changed Coverage Δ
src/Transformations.jl 97.46% <ø> (ø)

... and 4 files with indirect coverage changes

@mofeing mofeing changed the title Extended documentation for transformations.jl Document Transformations Jul 13, 2023
Copy link
Member

@mofeing mofeing left a comment

Choose a reason for hiding this comment

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

Great work! Just a couple of comments:

  • It's best practice to use the infinitive for explaining functions in the documentation (e.g. use "Reduce" instead of "Reduces". Imagine that function are like verbs or actions).
  • One of the main reasons why these methods were developed is because it drastically reduces the problem size of contraction path search. We should mention it.
  • Reducing the maximum rank of the Tensor Network is not what it solves, but reducing the rank (or better, size) of the involved tensors.
  • It would a good idea to cite the paper by Johnnie Gray and maybe say that we have taken inspiration? from quimb.
  • I think it would be great to put small examples inside the docstrings for each Transformation, so users can really appreciate each of them.

docs/src/transformations.md Outdated Show resolved Hide resolved
docs/src/transformations.md Outdated Show resolved Hide resolved
Comment on lines 12 to 30
# Examples
```julia-repl
julia> tn = TensorNetwork(...)
julia> transformed_tn = transform(tn, Tenet.RankSimplification)

julia> fig = Figure()
julia> ax1 = Axis(fig[1, 1]; title="Original TensorNetwork")
julia> p1 = plot!(ax1, tn; node_size=5.)
julia> ax2 = Axis(fig[1, 2], title="Transformed TensorNetwork")
julia> p2 = plot!(ax2, tn2; node_size=5.)
julia> ax1.titlesize=20
julia> ax2.titlesize=20
```
```@raw html
<figure>
<img width=500 src="../assets/transformation.svg" alt="Before and after transformation in a Tensor Network">
</figure>
```

Copy link
Member

Choose a reason for hiding this comment

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

I prefer to put examples inside the docstrings of the different Transformations, so the user can check their effect.

(Use small examples)

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we show a visual representation for each transformation? Maybe this would be too much

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 this would be a good idea, but using very small tensor networks. Similar to what they do in the paper with the diagrams.

Copy link
Member

Choose a reason for hiding this comment

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

I can help with this if you need help.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will try to create some examples, I will let you know!

docs/src/transformations.md Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
transformation.svg Outdated Show resolved Hide resolved
@jofrevalles jofrevalles requested a review from mofeing July 26, 2023 10:44
Copy link
Member

@mofeing mofeing left a comment

Choose a reason for hiding this comment

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

@jofrevalles please, revise these requests.

src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
src/Transformations.jl Outdated Show resolved Hide resolved
docs/src/transformations.md Outdated Show resolved Hide resolved
docs/src/transformations.md Outdated Show resolved Hide resolved
@jofrevalles
Copy link
Member Author

jofrevalles commented Jul 27, 2023

@mofeing thanks for the comments, now the docs work as expected

@mofeing
Copy link
Member

mofeing commented Jul 27, 2023

I prefer multiple smaller examples and leave the RQC for the examples, but it's good enough right now. I will change it in the future.

@mofeing mofeing merged commit 9e5349d into master Jul 27, 2023
4 of 5 checks passed
@mofeing mofeing deleted the feature/extend-transform-docs branch July 27, 2023 15:11
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