diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml index 08f664cd..4c49a86f 100644 --- a/.JuliaFormatter.toml +++ b/.JuliaFormatter.toml @@ -1,2 +1,3 @@ +# See https://domluna.github.io/JuliaFormatter.jl/stable/ for a list of options style = "blue" indent = 2 diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md new file mode 100644 index 00000000..5f6e325c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.md @@ -0,0 +1,62 @@ +--- +name: ITensorNetworks.jl bug report +about: Create a bug report to help us improve ITensorNetworks.jl +title: "[BUG] YOUR SHORT DESCRIPTION OF THE BUG HERE" +labels: ["bug"] +assignees: '' + +--- + +**Description of bug** + +Please give a brief description of the bug or unexpected behavior here. + +**Minimal code demonstrating the bug or unexpected behavior** + +If applicable, provide a minimal code that can be run to demonstrate the bug or unexpected behavior. + +If you are unable to construct a minimal code that demonstrates the bug or unexpected behavior, provide detailed steps for how to reproduce the behavior you are seeing. + +
Minimal runnable code

+ +```julia +[YOUR MINIMAL RUNNABLE CODE HERE] +``` + +

+ + +**Expected output or behavior** + +Describe what you expected to happen. + +If you provided a minimal code that can be run to demonstrate the bug or unexpected behavior, describe what you expected the output would be. + + +**Actual output or behavior** + +Describe what actually happened. + +If you provided a minimal code that demonstrates the bug or unexpected behavior, provide the output you get from that code. If the code leads to an error or warning, include the full error or warning below. + +
Output of minimal runnable code

+ +```julia +[OUTPUT OF YOUR MINIMAL RUNNABLE CODE HERE] +``` + +

+ + +**Version information** + + - Output from `versioninfo()`: +```julia +julia> versioninfo() +[YOUR OUTPUT HERE] +``` + - Output from `using Pkg; Pkg.status("ITensorNetworks")`: +```julia +julia> using Pkg; Pkg.status("ITensorNetworks") +[YOUR OUTPUT HERE] +``` diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md new file mode 100644 index 00000000..543206a6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md @@ -0,0 +1,24 @@ +--- +name: ITensorNetworks.jl feature request +about: Suggest an idea for ITensorNetworks.jl +title: "[ENHANCEMENT] YOUR SHORT DESCRIPTION OF THE FEATURE REQUEST HERE" +labels: ["enhancement"] +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** + +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** + +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** + +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** + +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..80c004c0 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,42 @@ +# Description + +Please include a summary of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes #(issue) + +If practical and applicable, please include a minimal demonstration of the previous behavior and new behavior below. + +
Minimal demonstration of previous behavior

+ +```julia +[YOUR MINIMAL DEMONSTRATION OF PREVIOUS BEHAVIOR] +``` + +

+ +
Minimal demonstration of new behavior

+ +```julia +[YOUR MINIMAL DEMONSTRATION OF NEW BEHAVIOR] +``` + +

+ +# How Has This Been Tested? + +Please add tests that verify your changes to a file in the `test` directory. + +Please give a summary of the tests that you added to verify your changes. + +- [ ] Test A +- [ ] Test B + +# Checklist: + +- [ ] My code follows the style guidelines of this project. Please run `using JuliaFormatter; format(".")` in the base directory of the repository (`~/.julia/dev/ITensorNetworks`) to format your code according to our style guidelines. +- [ ] I have performed a self-review of my own code. +- [ ] I have commented my code, particularly in hard-to-understand areas. +- [ ] I have added tests that verify the behavior of the changes I made. +- [ ] I have made corresponding changes to the documentation. +- [ ] My changes generate no new warnings. +- [ ] Any dependent changes have been merged and published in downstream modules. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..700707ce --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index d4f1c07d..00000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: CI -on: - push: - branches: - - main - tags: '*' - pull_request: -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - version: - - '1' - os: - - ubuntu-latest - - macOS-latest - - windows-latest - arch: - - x64 - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v1 - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v2 - with: - files: lcov.info - docs: - name: Documentation - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: '1' - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-docdeploy@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - - run: | - julia --project=docs -e ' - using Documenter: DocMeta, doctest - using ITensorNetworks - DocMeta.setdocmeta!(ITensorNetworks, :DocTestSetup, :(using ITensorNetworks); recursive=true) - doctest(ITensorNetworks)' diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index cba9134c..456fa05d 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,16 +1,16 @@ -name: CompatHelper +name: "CompatHelper" + on: schedule: - cron: 0 0 * * * workflow_dispatch: +permissions: + contents: write + pull-requests: write + jobs: - CompatHelper: - runs-on: ubuntu-latest - steps: - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} - run: julia -e 'using CompatHelper; CompatHelper.main()' + compat-helper: + name: "CompatHelper" + uses: "ITensor/ITensorActions/.github/workflows/CompatHelper.yml@main" + with: + localregistry: "https://github.com/ITensor/ITensorRegistry.git" diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 00000000..01a7f7a4 --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,23 @@ +name: "Documentation" + +on: + push: + branches: + - main + tags: '*' + pull_request: + schedule: + - cron: '1 4 * * 4' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }} + +jobs: + build-and-deploy-docs: + name: "Documentation" + uses: "ITensor/ITensorActions/.github/workflows/Documentation.yml@main" + with: + localregistry: https://github.com/ITensor/ITensorRegistry.git + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml new file mode 100644 index 00000000..3f78afc2 --- /dev/null +++ b/.github/workflows/FormatCheck.yml @@ -0,0 +1,13 @@ +name: "Format Check" + +on: + push: + branches: + - 'main' + tags: '*' + pull_request: + +jobs: + format-check: + name: "Format Check" + uses: "ITensor/ITensorActions/.github/workflows/FormatCheck.yml@main" diff --git a/.github/workflows/IntegrationTestRequest.yml b/.github/workflows/IntegrationTestRequest.yml new file mode 100644 index 00000000..d42fccaa --- /dev/null +++ b/.github/workflows/IntegrationTestRequest.yml @@ -0,0 +1,14 @@ +name: "Integration Test Request" + +on: + issue_comment: + types: [created] + +jobs: + integrationrequest: + if: | + github.event.issue.pull_request && + contains(fromJSON('["OWNER", "COLLABORATOR", "MEMBER"]'), github.event.comment.author_association) + uses: ITensor/ITensorActions/.github/workflows/IntegrationTestRequest.yml@main + with: + localregistry: https://github.com/ITensor/ITensorRegistry.git diff --git a/.github/workflows/LiterateCheck.yml b/.github/workflows/LiterateCheck.yml new file mode 100644 index 00000000..2ca5f27e --- /dev/null +++ b/.github/workflows/LiterateCheck.yml @@ -0,0 +1,15 @@ +name: "Literate Check" + +on: + push: + branches: + - 'main' + tags: '*' + pull_request: + +jobs: + literate: + name: "Literate Check" + uses: "ITensor/ITensorActions/.github/workflows/LiterateCheck.yml@main" + with: + localregistry: https://github.com/ITensor/ITensorRegistry.git diff --git a/.github/workflows/Registrator.yml b/.github/workflows/Registrator.yml new file mode 100644 index 00000000..255e2af9 --- /dev/null +++ b/.github/workflows/Registrator.yml @@ -0,0 +1,24 @@ +name: Register Package +on: + workflow_dispatch: + pull_request: + types: + - closed + paths: + - 'Project.toml' + branches: + - 'master' + - 'main' + +permissions: + contents: write + pull-requests: write + +jobs: + Register: + if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true + uses: "ITensor/ITensorActions/.github/workflows/Registrator.yml@main" + with: + localregistry: ITensor/ITensorRegistry + secrets: + REGISTRATOR_KEY: ${{ secrets.REGISTRATOR_KEY }} diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index f49313b6..0cd3114e 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -4,6 +4,22 @@ on: types: - created workflow_dispatch: + inputs: + lookback: + default: "3" +permissions: + actions: read + checks: read + contents: write + deployments: read + issues: read + discussions: read + packages: read + pages: read + pull-requests: read + repository-projects: read + security-events: read + statuses: read jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 00000000..5a0a3064 --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,42 @@ +name: Tests +on: + push: + branches: + - 'master' + - 'main' + - 'release-' + tags: '*' + paths-ignore: + - 'docs/**' + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + # Cancel intermediate builds: only if it is a pull request build. + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + tests: + name: "Tests" + strategy: + fail-fast: false + matrix: + version: + - 'lts' # minimal supported version + - '1' # latest released Julia version + # group: + # - 'core' + # - 'optional' + os: + - ubuntu-latest + - macOS-latest + - windows-latest + uses: "ITensor/ITensorActions/.github/workflows/Tests.yml@main" + with: + group: "${{ matrix.group }}" + julia-version: "${{ matrix.version }}" + os: "${{ matrix.os }}" + localregistry: https://github.com/ITensor/ITensorRegistry.git + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/VersionCheck.yml b/.github/workflows/VersionCheck.yml new file mode 100644 index 00000000..69444f1b --- /dev/null +++ b/.github/workflows/VersionCheck.yml @@ -0,0 +1,11 @@ +name: "Version Check" + +on: + pull_request: + +jobs: + version-check: + name: "Version Check" + uses: "ITensor/ITensorActions/.github/workflows/VersionCheck.yml@main" + with: + localregistry: https://github.com/ITensor/ITensorRegistry.git diff --git a/.github/workflows/format_check.yml b/.github/workflows/format_check.yml deleted file mode 100644 index c48c91cf..00000000 --- a/.github/workflows/format_check.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Format check -on: - push: - branches: [main] - tags: [v*] - pull_request: - -jobs: - format: - name: "Format Check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: 1 - - name: Install JuliaFormatter and format - run: | - julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))' - julia -e 'using JuliaFormatter; format(".", verbose=true)' - - name: Check format - run: | - julia -e ' - out = Cmd(`git diff --name-only`) |> read |> String - if out == "" - exit(0) - else - @error "The following files have not been formatted:" - write(stdout, out) - out_diff = Cmd(`git diff`) |> read |> String - @error "Diff:" - write(stdout, out_diff) - exit(1) - @error "" - end' diff --git a/.github/workflows/format_pr.yml b/.github/workflows/format_pr.yml deleted file mode 100644 index b7a9268d..00000000 --- a/.github/workflows/format_pr.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: format-pr -on: - schedule: - - cron: '0 0 * * *' -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install JuliaFormatter and format - run: | - julia -e 'import Pkg; Pkg.add("JuliaFormatter")' - julia -e 'using JuliaFormatter; format(".")' - # https://github.com/marketplace/actions/create-pull-request - # https://github.com/peter-evans/create-pull-request#reference-example - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Format .jl files - title: 'Automatic JuliaFormatter.jl run' - branch: auto-juliaformatter-pr - delete-branch: true - labels: formatting, automated pr, no changelog - - name: Check outputs - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/format_suggestions.yml b/.github/workflows/format_suggestions.yml deleted file mode 100644 index f6f268c0..00000000 --- a/.github/workflows/format_suggestions.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Format suggestions - -on: - pull_request: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - format: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest - with: - version: 1 - - run: | - julia -e 'using Pkg; Pkg.add("JuliaFormatter")' - julia -e 'using JuliaFormatter; format("."; verbose=true)' - - uses: reviewdog/action-suggester@v1 - with: - tool_name: JuliaFormatter - fail_on_error: true - filter_mode: added diff --git a/.github/workflows/register.yml b/.github/workflows/register.yml deleted file mode 100644 index 6e71f2f9..00000000 --- a/.github/workflows/register.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Register Package -on: - workflow_dispatch: - inputs: - version: - description: Version to register or component to bump - required: true -jobs: - register: - runs-on: ubuntu-latest - steps: - - uses: julia-actions/RegisterAction@latest - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 3b6efde2..10593a9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,14 @@ +*.jl.*.cov +*.jl.cov +*.jl.mem *.o *.swp -.tmp -*.cov -docs/build/ -precompile/tmp .DS_Store -benchmark/*.json .benchmarkci +.tmp .vscode/ Manifest.toml +benchmark/*.json docs/Manifest.toml -test/Manifest.toml +docs/build/ +docs/src/index.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..65993659 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-merge-conflict + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + exclude_types: [markdown] # incompatible with Literate.jl + +- repo: "https://github.com/domluna/JuliaFormatter.jl" + rev: v1.0.62 + hooks: + - id: "julia-formatter" diff --git a/LICENSE b/LICENSE index 3d5bac50..97fbd04f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,201 @@ -MIT License - -Copyright (c) 2021 Matthew Fishman , Joseph Tindall and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 The Simons Foundation, Inc. - All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Project.toml b/Project.toml index 3347daa6..b8594b64 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ITensorNetworks" uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7" authors = ["Matthew Fishman , Joseph Tindall and contributors"] -version = "0.12.1" +version = "0.12.2" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" @@ -22,7 +22,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19" -PackageExtensionCompat = "65ce6f38-6b18-4e1d-a461-8949797d7930" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SerializedElementArrays = "d3ce8812-9567-47e9-a7b5-65a6d70a3065" @@ -74,7 +73,6 @@ NDTensors = "0.3, 0.4" NamedGraphs = "0.6.0" OMEinsumContractionOrders = "0.8.3, 0.9" Observers = "0.2.4" -PackageExtensionCompat = "1" SerializedElementArrays = "0.1" SimpleTraits = "0.9" SparseArrayKit = "0.3, 0.4" diff --git a/README.md b/README.md index 3e0dbb7c..96d5ab0e 100644 --- a/README.md +++ b/README.md @@ -10,334 +10,44 @@ > In short, use this package with caution, and don't expect the interface to be stable > or for us to clearly announce parts of the code we are changing. +# ITensorNetworks.jl +[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://itensor.github.io/ITensorNetworks.jl/stable/) +[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://itensor.github.io/ITensorNetworks.jl/dev/) +[![Build Status](https://github.com/ITensor/ITensorNetworks.jl/actions/workflows/Tests.yml/badge.svg?branch=main)](https://github.com/ITensor/ITensorNetworks.jl/actions/workflows/Tests.yml?query=branch%3Amain) +[![Coverage](https://codecov.io/gh/ITensor/ITensorNetworks.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ITensor/ITensorNetworks.jl) +[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle) +[![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) -# ITensorNetworks +## Support -A package to provide general network data structures and tools to use with ITensors.jl. + + + Flatiron Center for Computational Quantum Physics logo. + +ITensorNetworks.jl is supported by the Flatiron Institute, a division of the Simons Foundation. -## Installation - -You can install this package through the Julia package manager: -```julia -julia> ] add ITensorNetworks -``` - +## Installation instructions - -## Examples - -Here are is an example of making a tensor network on a chain graph (a tensor train or matrix product state): +This package can be added as usual through the package manager: ```julia -julia> using Graphs: neighbors, path_graph - -julia> using ITensorNetworks: ITensorNetwork - -julia> tn = ITensorNetwork(path_graph(4); link_space=2) -ITensorNetworks.ITensorNetwork{Int64} with 4 vertices: -4-element NamedGraphs.OrderedDictionaries.OrderedIndices{Int64} - 1 - 2 - 3 - 4 - -and 3 edge(s): -1 => 2 -2 => 3 -3 => 4 - -with vertex data: -4-element Dictionaries.Dictionary{Int64, Any} - 1 │ ((dim=2|id=664|"1,2"),) - 2 │ ((dim=2|id=664|"1,2"), (dim=2|id=561|"2,3")) - 3 │ ((dim=2|id=561|"2,3"), (dim=2|id=47|"3,4")) - 4 │ ((dim=2|id=47|"3,4"),) - -julia> tn[1] -ITensor ord=1 (dim=2|id=664|"1,2") -NDTensors.EmptyStorage{NDTensors.EmptyNumber, NDTensors.Dense{NDTensors.EmptyNumber, Vector{NDTensors.EmptyNumber}}} - -julia> tn[2] -ITensor ord=2 (dim=2|id=664|"1,2") (dim=2|id=561|"2,3") -NDTensors.EmptyStorage{NDTensors.EmptyNumber, NDTensors.Dense{NDTensors.EmptyNumber, Vector{NDTensors.EmptyNumber}}} - -julia> neighbors(tn, 1) -1-element Vector{Int64}: - 2 - -julia> neighbors(tn, 2) -2-element Vector{Int64}: - 1 - 3 - -julia> neighbors(tn, 3) -2-element Vector{Int64}: - 2 - 4 +julia> using Pkg: Pkg -julia> neighbors(tn, 4) -1-element Vector{Int64}: - 3 +julia> Pkg.add("ITensorNetworks") ``` +## Examples -and here is a similar example for making a tensor network on a grid (a tensor product state or project entangled pair state (PEPS)): - -```julia -julia> using NamedGraphs.GraphsExtensions: subgraph - -julia> using NamedGraphs.NamedGraphGenerators: named_grid - -julia> tn = ITensorNetwork(named_grid((2, 2)); link_space=2) -ITensorNetworks.ITensorNetwork{Tuple{Int64, Int64}} with 4 vertices: -4-element NamedGraphs.OrderedDictionaries.OrderedIndices{Tuple{Int64, Int64}} - (1, 1) - (2, 1) - (1, 2) - (2, 2) - -and 4 edge(s): -(1, 1) => (2, 1) -(1, 1) => (1, 2) -(2, 1) => (2, 2) -(1, 2) => (2, 2) - -with vertex data: -4-element Dictionaries.Dictionary{Tuple{Int64, Int64}, Any} - (1, 1) │ ((dim=2|id=68|"1×1,2×1"), (dim=2|id=516|"1×1,1×2")) - (2, 1) │ ((dim=2|id=68|"1×1,2×1"), (dim=2|id=538|"2×1,2×2")) - (1, 2) │ ((dim=2|id=516|"1×1,1×2"), (dim=2|id=278|"1×2,2×2")) - (2, 2) │ ((dim=2|id=538|"2×1,2×2"), (dim=2|id=278|"1×2,2×2")) - -julia> tn[1, 1] -ITensor ord=2 (dim=2|id=68|"1×1,2×1") (dim=2|id=516|"1×1,1×2") -NDTensors.EmptyStorage{NDTensors.EmptyNumber, NDTensors.Dense{NDTensors.EmptyNumber, Vector{NDTensors.EmptyNumber}}} - -julia> neighbors(tn, (1, 1)) -2-element Vector{Tuple{Int64, Int64}}: - (2, 1) - (1, 2) - -julia> neighbors(tn, (1, 2)) -2-element Vector{Tuple{Int64, Int64}}: - (1, 1) - (2, 2) - -julia> tn_1 = subgraph(v -> v[1] == 1, tn) -ITensorNetworks.ITensorNetwork{Tuple{Int64, Int64}} with 2 vertices: -2-element NamedGraphs.OrderedDictionaries.OrderedIndices{Tuple{Int64, Int64}} - (1, 1) - (1, 2) - -and 1 edge(s): -(1, 1) => (1, 2) - -with vertex data: -2-element Dictionaries.Dictionary{Tuple{Int64, Int64}, Any} - (1, 1) │ ((dim=2|id=68|"1×1,2×1"), (dim=2|id=516|"1×1,1×2")) - (1, 2) │ ((dim=2|id=516|"1×1,1×2"), (dim=2|id=278|"1×2,2×2")) - -julia> tn_2 = subgraph(v -> v[1] == 2, tn) -ITensorNetworks.ITensorNetwork{Tuple{Int64, Int64}} with 2 vertices: -2-element NamedGraphs.OrderedDictionaries.OrderedIndices{Tuple{Int64, Int64}} - (2, 1) - (2, 2) - -and 1 edge(s): -(2, 1) => (2, 2) - -with vertex data: -2-element Dictionaries.Dictionary{Tuple{Int64, Int64}, Any} - (2, 1) │ ((dim=2|id=68|"1×1,2×1"), (dim=2|id=538|"2×1,2×2")) - (2, 2) │ ((dim=2|id=538|"2×1,2×2"), (dim=2|id=278|"1×2,2×2")) -``` - - -Networks can also be merged/unioned: - -```julia -julia> using ITensors: prime - -julia> using ITensorNetworks: ⊗, contract, contraction_sequence, siteinds - -julia> using ITensorUnicodePlots: @visualize - -julia> s = siteinds("S=1/2", named_grid(3)) -ITensorNetworks.IndsNetwork{Int64, ITensors.Index} with 3 vertices: -3-element NamedGraphs.OrderedDictionaries.OrderedIndices{Int64} - 1 - 2 - 3 - -and 2 edge(s): -1 => 2 -2 => 3 - -with vertex data: -3-element Dictionaries.Dictionary{Int64, Vector{ITensors.Index}} - 1 │ ITensors.Index[(dim=2|id=549|"S=1/2,Site,n=1")] - 2 │ ITensors.Index[(dim=2|id=718|"S=1/2,Site,n=2")] - 3 │ ITensors.Index[(dim=2|id=254|"S=1/2,Site,n=3")] - -and edge data: -0-element Dictionaries.Dictionary{NamedGraphs.NamedEdge{Int64}, Vector{ITensors.Index}} - -julia> tn1 = ITensorNetwork(s; link_space=2) -ITensorNetworks.ITensorNetwork{Int64} with 3 vertices: -3-element NamedGraphs.OrderedDictionaries.OrderedIndices{Int64} - 1 - 2 - 3 - -and 2 edge(s): -1 => 2 -2 => 3 - -with vertex data: -3-element Dictionaries.Dictionary{Int64, Any} - 1 │ ((dim=2|id=549|"S=1/2,Site,n=1"), (dim=2|id=149|"1,2")) - 2 │ ((dim=2|id=718|"S=1/2,Site,n=2"), (dim=2|id=149|"1,2"), (dim=2|id=113|"2,3… - 3 │ ((dim=2|id=254|"S=1/2,Site,n=3"), (dim=2|id=113|"2,3")) - -julia> tn2 = ITensorNetwork(s; link_space=2) -ITensorNetworks.ITensorNetwork{Int64} with 3 vertices: -3-element NamedGraphs.OrderedDictionaries.OrderedIndices{Int64} - 1 - 2 - 3 - -and 2 edge(s): -1 => 2 -2 => 3 - -with vertex data: -3-element Dictionaries.Dictionary{Int64, Any} - 1 │ ((dim=2|id=549|"S=1/2,Site,n=1"), (dim=2|id=407|"1,2")) - 2 │ ((dim=2|id=718|"S=1/2,Site,n=2"), (dim=2|id=407|"1,2"), (dim=2|id=205|"2,3… - 3 │ ((dim=2|id=254|"S=1/2,Site,n=3"), (dim=2|id=205|"2,3")) - -julia> @visualize tn1; - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀tn11⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠉⠢⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠈⠑⠢2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠢⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀tn12⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠈⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀2⠢⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠢⣀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀tn13⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - -julia> @visualize tn2; - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀tn21⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠉⠢⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠈⠑⠢2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠢⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀tn22⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠈⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀2⠢⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠢⣀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀tn23⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - -julia> Z = prime(tn1; sites=[]) ⊗ tn2; - -julia> @visualize Z; - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀Z(3, 1)⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀Z(3, 2)⠤⠔⠒⠒⠒⠒2⠉⠉⠉⠉⠁⠀⣀⠔⠉⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠔⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀2⠀⠀⠀Z(2, 1)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⡠⢼⠔⠒⠊2⠥⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⡠⠤(2)'⠁⠀⠀⡜⢀⠤⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀Z(1, 1)⠒⠒⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀Z(2, 2)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠑⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠒⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠘⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀2⠒⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀2⢆⠀⠀⠀⠀⠀⡠⠔⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠀⡠⠔⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀Z(1, 2)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - -julia> contraction_sequence(Z) -2-element Vector{Vector}: - NamedGraphs.Keys.Key{Tuple{Int64, Int64}}[Key((1, 1)), Key((1, 2))] - Any[Key((2, 1)), Any[Key((2, 2)), NamedGraphs.Keys.Key{Tuple{Int64, Int64}}[Key((3, 1)), Key((3, 2))]]] - -julia> Z̃ = contract(Z, (1, 1) => (2, 1)); - -julia> @visualize Z̃; - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀Z̃(3, 2)⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠜⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠑⠒⠒⠒⠒⠢2⠤⠤⠤⠤⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉Z̃(3, 1)⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⡔2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠊⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⢀⠜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2)'⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⢠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡰⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀Z̃(2, 2)⠤⠤⠤⠤⢄⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉2⠉⠉⠉⠒⠒⠒⠒⠒⠢⠤Z̃(2, 1)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠑⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠤⠒⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀2⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠤⠒⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢢⠀⠀⠀⠀⠀⠀⠀⠀⣀⡠⠤⠒⠉2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⣀⡠⠔⠒⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀Z̃(1, 2)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -``` - - -## Generating this README +````julia +using ITensorNetworks: ITensorNetworks +```` +Examples go here. +--- -This file was generated with [Weave.jl](https://github.com/JunoLab/Weave.jl) with the following commands: +*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).* -```julia -using ITensorNetworks: ITensorNetworks -using Weave: Weave -Weave.weave( - joinpath(pkgdir(ITensorNetworks), "examples", "README.jl"); - doctype="github", - out_path=pkgdir(ITensorNetworks), -) -``` diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 00000000..7efdaebd --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,7 @@ +using ITensorNetworks +using BenchmarkTools + +SUITE = BenchmarkGroup() +SUITE["rand"] = @benchmarkable rand(10) + +# Write your benchmarks here. diff --git a/docs/Project.toml b/docs/Project.toml index 8722e819..41ba6ca9 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,9 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7" +Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" + +[compat] +Documenter = "1.10.0" +ITensorNetworks = "0.12.0" +Literate = "2.20.1" diff --git a/docs/make.jl b/docs/make.jl index 09bfcd83..84a3147c 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,21 +1,25 @@ -using ITensorNetworks -using Documenter +using ITensorNetworks: ITensorNetworks +using Documenter: Documenter, DocMeta, deploydocs, makedocs DocMeta.setdocmeta!( ITensorNetworks, :DocTestSetup, :(using ITensorNetworks); recursive=true ) +include("make_index.jl") + makedocs(; modules=[ITensorNetworks], - authors="Matthew Fishman , Joseph Tindall and contributors", - repo="https://github.com/mtfishman/ITensorNetworks.jl/blob/{commit}{path}#{line}", + authors="ITensor developers and contributors", sitename="ITensorNetworks.jl", format=Documenter.HTML(; - prettyurls=get(ENV, "CI", "false") == "true", - canonical="https://mtfishman.github.io/ITensorNetworks.jl", - assets=String[], + canonical="https://itensor.github.io/ITensorNetworks.jl", + edit_link="main", + assets=["assets/favicon.ico", "assets/extras.css"], ), - pages=["Home" => "index.md"], + pages=["Home" => "index.md", "Reference" => "reference.md"], + warnonly=true, ) -deploydocs(; repo="github.com/mtfishman/ITensorNetworks.jl", devbranch="main") +deploydocs(; + repo="github.com/ITensor/ITensorNetworks.jl", devbranch="main", push_preview=true +) diff --git a/docs/make_index.jl b/docs/make_index.jl new file mode 100644 index 00000000..b2b46b8a --- /dev/null +++ b/docs/make_index.jl @@ -0,0 +1,21 @@ +using Literate: Literate +using ITensorNetworks: ITensorNetworks + +function ccq_logo(content) + include_ccq_logo = """ + ```@raw html + Flatiron Center for Computational Quantum Physics logo. + Flatiron Center for Computational Quantum Physics logo. + ``` + """ + content = replace(content, "{CCQ_LOGO}" => include_ccq_logo) + return content +end + +Literate.markdown( + joinpath(pkgdir(ITensorNetworks), "examples", "README.jl"), + joinpath(pkgdir(ITensorNetworks), "docs", "src"); + flavor=Literate.DocumenterFlavor(), + name="index", + postprocess=ccq_logo, +) diff --git a/docs/make_readme.jl b/docs/make_readme.jl new file mode 100644 index 00000000..2324636e --- /dev/null +++ b/docs/make_readme.jl @@ -0,0 +1,21 @@ +using Literate: Literate +using ITensorNetworks: ITensorNetworks + +function ccq_logo(content) + include_ccq_logo = """ + + + Flatiron Center for Computational Quantum Physics logo. + + """ + content = replace(content, "{CCQ_LOGO}" => include_ccq_logo) + return content +end + +Literate.markdown( + joinpath(pkgdir(ITensorNetworks), "examples", "README.jl"), + joinpath(pkgdir(ITensorNetworks)); + flavor=Literate.CommonMarkFlavor(), + name="README", + postprocess=ccq_logo, +) diff --git a/docs/src/assets/CCQ-dark.png b/docs/src/assets/CCQ-dark.png new file mode 100644 index 00000000..fbaef522 Binary files /dev/null and b/docs/src/assets/CCQ-dark.png differ diff --git a/docs/src/assets/CCQ.png b/docs/src/assets/CCQ.png new file mode 100644 index 00000000..e13f9083 Binary files /dev/null and b/docs/src/assets/CCQ.png differ diff --git a/docs/src/assets/extras.css b/docs/src/assets/extras.css new file mode 100644 index 00000000..aaab0f8b --- /dev/null +++ b/docs/src/assets/extras.css @@ -0,0 +1,15 @@ +.display-light-only { + display: block; +} + +.display-dark-only { + display: none; +} + +.theme--documenter-dark .display-light-only { + display: none; +} + +.theme--documenter-dark .display-dark-only { + display: block; +} diff --git a/docs/src/assets/favicon.ico b/docs/src/assets/favicon.ico new file mode 100644 index 00000000..0b067807 Binary files /dev/null and b/docs/src/assets/favicon.ico differ diff --git a/docs/src/assets/logo-dark.png b/docs/src/assets/logo-dark.png new file mode 100644 index 00000000..74506351 Binary files /dev/null and b/docs/src/assets/logo-dark.png differ diff --git a/docs/src/assets/logo.png b/docs/src/assets/logo.png new file mode 100644 index 00000000..2682e149 Binary files /dev/null and b/docs/src/assets/logo.png differ diff --git a/docs/src/index.md b/docs/src/index.md deleted file mode 100644 index fe7a721c..00000000 --- a/docs/src/index.md +++ /dev/null @@ -1,14 +0,0 @@ -```@meta -CurrentModule = ITensorNetworks -``` - -# ITensorNetworks - -Documentation for [ITensorNetworks](https://github.com/mtfishman/ITensorNetworks.jl). - -```@index -``` - -```@autodocs -Modules = [ITensorNetworks] -``` diff --git a/docs/src/reference.md b/docs/src/reference.md new file mode 100644 index 00000000..3dc55f96 --- /dev/null +++ b/docs/src/reference.md @@ -0,0 +1,5 @@ +# Reference + +```@autodocs +Modules = [ITensorNetworks, ITensorNetworks.ModelNetworks, ITensorNetworks.ModelHamiltonians] +``` diff --git a/examples/Project.toml b/examples/Project.toml index a0736efc..c4ae6bbb 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -1,6 +1,5 @@ [deps] -Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7" -ITensorUnicodePlots = "73163f41-4a9e-479f-8353-73bf94dbd758" -NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19" -Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9" + +[compat] +ITensorNetworks = "0.12.0" diff --git a/examples/README.jl b/examples/README.jl index 1b81df26..d4148d43 100644 --- a/examples/README.jl +++ b/examples/README.jl @@ -1,85 +1,43 @@ -#' > [!WARNING] -#' > This is a pre-release software. There are no guarantees that functionality won't break -#' > from version to version, though we will try our best to indicate breaking changes -#' > following [semantic versioning](https://semver.org/) (semver) by bumping the minor -#' > version of the package. We are biasing heavily towards "moving fast and breaking things" -#' > during this stage of development, which will allow us to more quickly develop the package -#' > and bring it to a point where we have enough features and are happy enough with the external -#' > interface to officially release it for general public use. -#' > -#' > In short, use this package with caution, and don't expect the interface to be stable -#' > or for us to clearly announce parts of the code we are changing. - -#' # ITensorNetworks -#' -#' A package to provide general network data structures and tools to use with ITensors.jl. - -#' ## Installation -#' -#' You can install this package through the Julia package manager: -#' ```julia -#' julia> ] add ITensorNetworks -#' ``` - -#+ echo=false; term=false - -using Random: Random -using ITensors: ITensors -Random.seed!(ITensors.index_id_rng(), 1234); - -#' ## Examples -#' -#' Here are is an example of making a tensor network on a chain graph (a tensor train or matrix product state): -#+ term=true - -using Graphs: neighbors, path_graph -using ITensorNetworks: ITensorNetwork -tn = ITensorNetwork(path_graph(4); link_space=2) -tn[1] -tn[2] -neighbors(tn, 1) -neighbors(tn, 2) -neighbors(tn, 3) -neighbors(tn, 4) - -#' and here is a similar example for making a tensor network on a grid (a tensor product state or project entangled pair state (PEPS)): -#+ term=true - -using NamedGraphs.GraphsExtensions: subgraph -using NamedGraphs.NamedGraphGenerators: named_grid -tn = ITensorNetwork(named_grid((2, 2)); link_space=2) -tn[1, 1] -neighbors(tn, (1, 1)) -neighbors(tn, (1, 2)) -tn_1 = subgraph(v -> v[1] == 1, tn) -tn_2 = subgraph(v -> v[1] == 2, tn) - -#' Networks can also be merged/unioned: -#+ term=true - -using ITensors: prime -using ITensorNetworks: ⊗, contract, contraction_sequence, siteinds -using ITensorUnicodePlots: @visualize -s = siteinds("S=1/2", named_grid(3)) -tn1 = ITensorNetwork(s; link_space=2) -tn2 = ITensorNetwork(s; link_space=2) -@visualize tn1; -@visualize tn2; -Z = prime(tn1; sites=[]) ⊗ tn2; -@visualize Z; -contraction_sequence(Z) -Z̃ = contract(Z, (1, 1) => (2, 1)); -@visualize Z̃; - -#' ## Generating this README - -#' This file was generated with [Weave.jl](https://github.com/JunoLab/Weave.jl) with the following commands: -#+ eval=false +# > [!WARNING] +# > This is a pre-release software. There are no guarantees that functionality won't break +# > from version to version, though we will try our best to indicate breaking changes +# > following [semantic versioning](https://semver.org/) (semver) by bumping the minor +# > version of the package. We are biasing heavily towards "moving fast and breaking things" +# > during this stage of development, which will allow us to more quickly develop the package +# > and bring it to a point where we have enough features and are happy enough with the external +# > interface to officially release it for general public use. +# > +# > In short, use this package with caution, and don't expect the interface to be stable +# > or for us to clearly announce parts of the code we are changing. + +# # ITensorNetworks.jl +# +# [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://itensor.github.io/ITensorNetworks.jl/stable/) +# [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://itensor.github.io/ITensorNetworks.jl/dev/) +# [![Build Status](https://github.com/ITensor/ITensorNetworks.jl/actions/workflows/Tests.yml/badge.svg?branch=main)](https://github.com/ITensor/ITensorNetworks.jl/actions/workflows/Tests.yml?query=branch%3Amain) +# [![Coverage](https://codecov.io/gh/ITensor/ITensorNetworks.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ITensor/ITensorNetworks.jl) +# [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle) +# [![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) + +# ## Support +# +# {CCQ_LOGO} +# +# ITensorNetworks.jl is supported by the Flatiron Institute, a division of the Simons Foundation. + +# ## Installation instructions + +# This package can be added as usual through the package manager: + +#= +```julia +julia> using Pkg: Pkg + +julia> Pkg.add("ITensorNetworks") +``` +=# + +# ## Examples using ITensorNetworks: ITensorNetworks -using Weave: Weave -Weave.weave( - joinpath(pkgdir(ITensorNetworks), "examples", "README.jl"); - doctype="github", - out_path=pkgdir(ITensorNetworks), -) +# Examples go here. diff --git a/src/ITensorNetworks.jl b/src/ITensorNetworks.jl index bcdae764..2b16b030 100644 --- a/src/ITensorNetworks.jl +++ b/src/ITensorNetworks.jl @@ -1,4 +1,5 @@ module ITensorNetworks + include("lib/BaseExtensions/src/BaseExtensions.jl") include("lib/ITensorsExtensions/src/ITensorsExtensions.jl") include("visualize.jl") @@ -68,8 +69,4 @@ include("exports.jl") include("lib/ModelHamiltonians/src/ModelHamiltonians.jl") include("lib/ModelNetworks/src/ModelNetworks.jl") -using PackageExtensionCompat: @require_extensions -function __init__() - @require_extensions -end end diff --git a/test/test_treetensornetworks/test_solvers/ITensorNetworksTestSolversUtils/ITensorNetworksTestSolversUtils.jl b/test/ITensorNetworksTestSolversUtils/ITensorNetworksTestSolversUtils.jl similarity index 100% rename from test/test_treetensornetworks/test_solvers/ITensorNetworksTestSolversUtils/ITensorNetworksTestSolversUtils.jl rename to test/ITensorNetworksTestSolversUtils/ITensorNetworksTestSolversUtils.jl diff --git a/test/test_treetensornetworks/test_solvers/ITensorNetworksTestSolversUtils/solvers.jl b/test/ITensorNetworksTestSolversUtils/solvers.jl similarity index 100% rename from test/test_treetensornetworks/test_solvers/ITensorNetworksTestSolversUtils/solvers.jl rename to test/ITensorNetworksTestSolversUtils/solvers.jl diff --git a/test/Project.toml b/test/Project.toml index 9f31fcce..09126944 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,6 +1,7 @@ [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" DataGraphs = "b5a273c3-7e6c-41f6-98bd-8d7f1525a36a" Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4" @@ -24,10 +25,45 @@ Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0" OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" SplitApplyCombine = "03a91e81-4c3e-53e1-a0a4-9c0c8f19dd66" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228" -Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9" + +[compat] +AbstractTrees = "0.4.5" +Adapt = "4.3.0" +Aqua = "0.8.11" +Compat = "4.16.0" +DataGraphs = "0.2.6" +Dictionaries = "0.4.4" +Distributions = "0.25.118" +EinExprs = "0.6.8" +Glob = "1.3.1" +Graphs = "1.12.0" +GraphsFlows = "0.1.1" +ITensorGaussianMPS = "0.1.12" +ITensorMPS = "0.3.6" +ITensorNetworks = "0.12.2" +ITensorUnicodePlots = "0.1.6" +ITensors = "0.7, 0.8, 0.9" +KrylovKit = "0.8, 0.9" +Metis = "1.5.0" +NDTensors = "0.3, 0.4" +NamedGraphs = "0.6.6" +OMEinsumContractionOrders = "0.9.5" +Observers = "0.2.5" +OrdinaryDiffEqTsit5 = "1.1.0" +SafeTestsets = "0.1.0" +SplitApplyCombine = "1.2.3" +StableRNGs = "1.0.2" +Suppressor = "0.2.8" +TensorOperations = "5.1.4" +UnicodePlots = "3.7.2" +LinearAlgebra = "1.10.0" +Pkg = "1.10.0" +Random = "1.10.0" +Test = "1.10.0" diff --git a/test/runtests.jl b/test/runtests.jl index 6d854718..1c52c3e1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,16 +1,63 @@ -@eval module $(gensym()) -using Test: @test, @testset -using Glob: Glob -using ITensorNetworks: ITensorNetworks +using SafeTestsets: @safetestset +using Suppressor: Suppressor -# https://discourse.julialang.org/t/rdir-search-recursive-for-files-with-a-given-name-pattern/75605/12 -@testset "ITensorNetworks.jl, test directory $root" for (root, dirs, files) in walkdir( - joinpath(pkgdir(ITensorNetworks), "test") +# check for filtered groups +# either via `--group=ALL` or through ENV["GROUP"] +const pat = r"(?:--group=)(\w+)" +arg_id = findfirst(contains(pat), ARGS) +const GROUP = uppercase( + if isnothing(arg_id) + get(ENV, "GROUP", "ALL") + else + only(match(pat, ARGS[arg_id]).captures) + end, ) - test_files = filter!(f -> occursin(Glob.FilenameMatch("test_*.jl"), f), files) - @testset "Test file $test_file" for test_file in test_files - println("Running test file $test_file") - @time include(joinpath(root, test_file)) + +"match files of the form `test_*.jl`, but exclude `*setup*.jl`" +istestfile(fn) = + endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup") +"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`" +isexamplefile(fn) = + endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup") + +@time begin + # tests in groups based on folder structure + for testgroup in filter(isdir, readdir(@__DIR__)) + if GROUP == "ALL" || GROUP == uppercase(testgroup) + groupdir = joinpath(@__DIR__, testgroup) + for file in filter(istestfile, readdir(groupdir)) + filename = joinpath(groupdir, file) + @eval @safetestset $file begin + include($filename) + end + end + end + end + + # single files in top folder + for file in filter(istestfile, readdir(@__DIR__)) + (file == basename(@__FILE__)) && continue # exclude this file to avoid infinite recursion + @eval @safetestset $file begin + include($file) + end + end + + # test examples + examplepath = joinpath(@__DIR__, "..", "examples") + for (root, _, files) in walkdir(examplepath) + contains(chopprefix(root, @__DIR__), "setup") && continue + for file in filter(isexamplefile, files) + filename = joinpath(root, file) + @eval begin + @safetestset $file begin + $(Expr( + :macrocall, + GlobalRef(Suppressor, Symbol("@suppress")), + LineNumberNode(@__LINE__, @__FILE__), + :(include($filename)), + )) + end + end + end end -end end diff --git a/test/test_aqua.jl b/test/test_aqua.jl new file mode 100644 index 00000000..59c6ef22 --- /dev/null +++ b/test/test_aqua.jl @@ -0,0 +1,7 @@ +using ITensorNetworks: ITensorNetworks +using Aqua: Aqua +using Test: @testset + +@testset "Code quality (Aqua.jl)" begin + # Aqua.test_all(ITensorNetworks) +end diff --git a/test/test_examples/test_examples.jl b/test/test_examples.jl similarity index 100% rename from test/test_examples/test_examples.jl rename to test/test_examples.jl diff --git a/test/test_examples/Project.toml b/test/test_examples/Project.toml deleted file mode 100644 index cca8fc9b..00000000 --- a/test/test_examples/Project.toml +++ /dev/null @@ -1,8 +0,0 @@ -[deps] -Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" -ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7" -ITensorUnicodePlots = "73163f41-4a9e-479f-8353-73bf94dbd758" -NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19" -Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9" diff --git a/test/test_ext/Project.toml b/test/test_ext/Project.toml deleted file mode 100644 index 4d124728..00000000 --- a/test/test_ext/Project.toml +++ /dev/null @@ -1,5 +0,0 @@ -[deps] -Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7" -ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" -NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19" diff --git a/test/test_ext/test_itensornetworksadaptext.jl b/test/test_itensornetworksadaptext.jl similarity index 100% rename from test/test_ext/test_itensornetworksadaptext.jl rename to test/test_itensornetworksadaptext.jl diff --git a/test/test_treetensornetworks/Project.toml b/test/test_treetensornetworks/Project.toml deleted file mode 100644 index 05ed66f7..00000000 --- a/test/test_treetensornetworks/Project.toml +++ /dev/null @@ -1,6 +0,0 @@ -[deps] -Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4" -Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" -ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7" -ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" -NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19" diff --git a/test/test_treetensornetworks/test_solvers/Project.toml b/test/test_treetensornetworks/test_solvers/Project.toml deleted file mode 100644 index e4716249..00000000 --- a/test/test_treetensornetworks/test_solvers/Project.toml +++ /dev/null @@ -1,14 +0,0 @@ -[deps] -DataGraphs = "b5a273c3-7e6c-41f6-98bd-8d7f1525a36a" -Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4" -Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" -ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7" -ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" -KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" -NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19" -Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0" -OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" -Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" -Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/test_treetensornetworks/test_solvers/test_contract.jl b/test/test_ttn_contract.jl similarity index 100% rename from test/test_treetensornetworks/test_solvers/test_contract.jl rename to test/test_ttn_contract.jl diff --git a/test/test_treetensornetworks/test_solvers/test_dmrg.jl b/test/test_ttn_dmrg.jl similarity index 100% rename from test/test_treetensornetworks/test_solvers/test_dmrg.jl rename to test/test_ttn_dmrg.jl diff --git a/test/test_treetensornetworks/test_solvers/test_dmrg_x.jl b/test/test_ttn_dmrg_x.jl similarity index 100% rename from test/test_treetensornetworks/test_solvers/test_dmrg_x.jl rename to test/test_ttn_dmrg_x.jl diff --git a/test/test_treetensornetworks/test_expect.jl b/test/test_ttn_expect.jl similarity index 100% rename from test/test_treetensornetworks/test_expect.jl rename to test/test_ttn_expect.jl diff --git a/test/test_treetensornetworks/test_solvers/test_linsolve.jl b/test/test_ttn_linsolve.jl similarity index 100% rename from test/test_treetensornetworks/test_solvers/test_linsolve.jl rename to test/test_ttn_linsolve.jl diff --git a/test/test_treetensornetworks/test_position.jl b/test/test_ttn_position.jl similarity index 100% rename from test/test_treetensornetworks/test_position.jl rename to test/test_ttn_position.jl diff --git a/test/test_treetensornetworks/test_solvers/test_tdvp.jl b/test/test_ttn_tdvp.jl similarity index 100% rename from test/test_treetensornetworks/test_solvers/test_tdvp.jl rename to test/test_ttn_tdvp.jl diff --git a/test/test_treetensornetworks/test_solvers/test_tdvp_time_dependent.jl b/test/test_ttn_tdvp_time_dependent.jl similarity index 100% rename from test/test_treetensornetworks/test_solvers/test_tdvp_time_dependent.jl rename to test/test_ttn_tdvp_time_dependent.jl