Skip to content

Commit e6cee67

Browse files
Merge branch 'QuantumKitHub:master' into avoid_informing_user_precompilation
2 parents 11e2ad2 + f646b83 commit e6cee67

File tree

6 files changed

+179
-149
lines changed

6 files changed

+179
-149
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,50 @@
11
name: CompatHelper
2-
32
on:
43
schedule:
54
- cron: 0 0 * * *
65
workflow_dispatch:
7-
6+
permissions:
7+
contents: write
8+
pull-requests: write
89
jobs:
910
CompatHelper:
1011
runs-on: ubuntu-latest
1112
steps:
12-
- name: Pkg.add("CompatHelper")
13-
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
14-
- name: CompatHelper.main()
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v2
19+
with:
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
1542
env:
1643
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
# This repo uses Documenter, so we can reuse our [Documenter SSH key](https://documenter.juliadocs.org/stable/man/hosting/walkthrough/).
45+
# If we didn't have one of those setup, we could configure a dedicated ssh deploy key `COMPATHELPER_PRIV` following https://juliaregistries.github.io/CompatHelper.jl/dev/#Creating-SSH-Key.
46+
# Either way, we need an SSH key if we want the PRs that CompatHelper creates to be able to trigger CI workflows themselves.
47+
# That is because GITHUB_TOKEN's can't trigger other workflows (see https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow).
48+
# Check if you have a deploy key setup using these docs: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/reviewing-your-deploy-keys.
1749
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
18-
run: julia -e 'using CompatHelper; CompatHelper.main()'
50+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

.github/workflows/Documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
arch:
2222
- x64
2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@v6
2525
- uses: julia-actions/setup-julia@latest
2626
with:
2727
version: ${{ matrix.version }}

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
arch:
3232
- x64
3333
steps:
34-
- uses: actions/checkout@v5
34+
- uses: actions/checkout@v6
3535
- uses: julia-actions/setup-julia@v2
3636
with:
3737
version: ${{ matrix.version }}
@@ -61,7 +61,7 @@ jobs:
6161
arch:
6262
- x64
6363
steps:
64-
- uses: actions/checkout@v5
64+
- uses: actions/checkout@v6
6565
- uses: julia-actions/setup-julia@v2
6666
with:
6767
version: ${{ matrix.version }}

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TensorOperations"
22
uuid = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
3+
version = "5.4"
34
authors = ["Lukas Devos <lukas.devos@ugent.be>", "Maarten Van Damme <maartenvd1994@gmail.com>", "Jutho Haegeman <jutho.haegeman@ugent.be>"]
4-
version = "5.3.1"
55

66
[deps]
77
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
@@ -32,10 +32,10 @@ TensorOperationscuTENSORExt = ["cuTENSOR", "CUDA"]
3232
[compat]
3333
Aqua = "0.6, 0.7, 0.8"
3434
Bumper = "0.6, 0.7"
35-
CUDA = "5.4.0"
35+
CUDA = "5"
3636
ChainRulesCore = "1"
3737
ChainRulesTestUtils = "1"
38-
DynamicPolynomials = "0.5"
38+
DynamicPolynomials = "0.5, 0.6"
3939
LRUCache = "1"
4040
LinearAlgebra = "1.6"
4141
Logging = "1.6"

docs/src/man/indexnotation.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,23 @@ however different strategies to modify this order.
243243
because they share an index label which is next in the `order` list, all other indices
244244
with shared label among them will be contracted, irrespective of their order.
245245

246+
!!! warning "Combining order specifications"
247+
248+
Note that it is currently not possible to combine the NCON style convention of specifying
249+
indices with the use of parentheses. If both are used at the same time, the parentheses
250+
take precedence and the NCON style will be ignored. Any remaining contraction orders
251+
will be evaluated in the default left to right order. For example, in the following
252+
contractions, we have `E1 = A * ((B * D) * C)`, but `E2 = A * ((B * C) * D)`. This is
253+
true even when the parentheses are compatible with the NCON contraction order, as is
254+
the case here.
255+
256+
```julia
257+
@tensor E1[-1 -2 -3; -4] := A[-1 -2 -3; 4 5] * B[4; 1] * C[5; 2] * D[1 2; -4]
258+
@tensor E2[-1 -2 -3; -4] := A[-1 -2 -3; 4 5] * (B[4; 1] * C[5; 2] * D[1 2; -4])
259+
```
260+
261+
Additionally, combining the `order = (...)` keyword with parentheses is currently not supported.
262+
246263
In the case of more complex tensor networks, the optimal contraction order cannot always
247264
easily be guessed or determined on plain sight. It is then useful to be able to optimize the
248265
contraction order automatically, given a model for the complexity of contracting the

0 commit comments

Comments
 (0)