Skip to content

Commit 6230337

Browse files
authored
Merge pull request #304 from ACEsuit/dev-0.10
EquivariantTensors + J1.12 Port
2 parents 08ca97f + 0714368 commit 6230337

File tree

19 files changed

+1034
-465
lines changed

19 files changed

+1034
-465
lines changed

.github/workflows/CI.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ jobs:
2626
version:
2727
# - '1.10' (dramatic failures => to be understood)
2828
- '1.11'
29+
- '1.12'
2930
# - 'nightly'
30-
python-version:
31-
- '3.8'
31+
python-version:
32+
- '3.11'
3233
os:
3334
- ubuntu-latest
3435
arch:
@@ -144,8 +145,8 @@ jobs:
144145
Pkg.pkg"registry add https://github.com/ACEsuit/ACEregistry"
145146
shell: bash -c "julia --color=yes {0}"
146147
- uses: actions/setup-python@v2
147-
with:
148-
python-version: ${{ matrix.python-version }}
148+
with:
149+
python-version: '3.11'
149150
- uses: julia-actions/julia-buildpkg@v1
150151
- uses: julia-actions/julia-docdeploy@v1
151152
env:

CLAUDE.md

Lines changed: 451 additions & 0 deletions
Large diffs are not rendered by default.

Project.toml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ACEpotentials"
22
uuid = "3b96b61c-0fcc-4693-95ed-1ef9f35fcc53"
3-
version = "0.9.1"
3+
version = "0.10.0"
44

55
[deps]
66
ACEfit = "ad31a8ef-59f5-4a01-b543-a85c2f73e95c"
@@ -9,12 +9,13 @@ AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
99
AtomsBuilder = "f5cc8831-eeb7-4288-8d9f-d6c1ddb77004"
1010
AtomsCalculators = "a3e0e189-c65a-42c1-833c-339540406eb1"
1111
AtomsCalculatorsUtilities = "9855a07e-8816-4d1b-ac92-859c17475477"
12+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
1213
Bumper = "8ce10254-0962-460f-a3d8-1f77fea1446e"
1314
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
1415
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
1516
DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
1617
EmpiricalPotentials = "38527215-9240-4c91-a638-d4250620c9e2"
17-
EquivariantModels = "73ee3e68-46fd-466f-9c56-451dc0291ebc"
18+
EquivariantTensors = "5e107534-7145-4f8f-b06f-47a52840c895"
1819
ExtXYZ = "352459e4-ddd7-4360-8937-99dcb397b478"
1920
Folds = "41a02a25-b8f0-4f67-bc48-60067656b558"
2021
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
@@ -54,25 +55,26 @@ AtomsBase = "0.5"
5455
AtomsBuilder = "0.2.0"
5556
AtomsCalculators = "0.2"
5657
AtomsCalculatorsUtilities = "0.1"
57-
Bumper = "0.6"
58+
BenchmarkTools = "1.6.3"
59+
Bumper = "0.7"
5860
ChunkSplitters = "3.0"
59-
EquivariantModels = "0.0.6"
61+
EquivariantTensors = "0.3"
6062
ExtXYZ = "0.2.0"
6163
Interpolations = "0.15"
6264
PrettyTables = "1.3, 2.0"
6365
Reexport = "1"
6466
StaticArrays = "1"
6567
YAML = "0.4"
66-
Lux = "0.5"
67-
LuxCore = "0.1"
68+
Lux = "1.25"
69+
LuxCore = "1"
6870
RepLieGroups = "0.1.1"
69-
Optimisers = "0.3.4"
70-
Polynomials4ML = "0.3"
71-
Zygote = "0.6"
72-
julia = "1.10, 1.11"
71+
Optimisers = "0.3.4, 0.4"
72+
Polynomials4ML = "0.5"
73+
Zygote = "0.6, 0.7"
74+
julia = "1.10, 1.11, 1.12"
7375
SparseArrays = "1.10"
7476
NamedTupleTools = "0.13, 0.14"
75-
SpheriCart = "0.1"
77+
SpheriCart = "0.2"
7678

7779
[extras]
7880
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,34 @@
1212
- Version 0.6.x uses `ACE1.jl` as a backend. It is mature and suitable for linear models with few species. This is not longer actively developed, but critical bugfixes can still be provided. [[docs-v0.6]](https://acesuit.github.io/ACEpotentials.jl/v0.6/)
1313
- Version 0.7.x is reserved
1414
- Version 0.8.x and onwards provides a new and much more flexible implementation, and integrates with the [AtomsBase](https://github.com/JuliaMolSim/AtomsBase.jl) ecosystem. Most but not all features from 0.6.x have been ported to this re-implementation. Usability should be the same or improved for most end-users. For developers this provides a much more flexible framework for experimentation. [[docs-v0.8]](https://acesuit.github.io/ACEpotentials.jl/dev/)
15-
- Version 0.9 onwards is technically compatible with Julia 1.10, but some unit tests show unexplained increases in fit accuracy, hence we highly recommend to use it only with Julia 1.11.
15+
- Version 0.9.0 onwards is technically compatible with Julia 1.10, but some unit tests show unexplained increases in fit accuracy, hence we highly recommend to use it only with Julia 1.11.
16+
- Version 0.10 migrates internally to `EquivariantTensors.jl` for improved maintainability, flexibility for model building and different execution backends. User-facing API remains unchanged; existing code should mostly continue to work. Note however that support for the fast evaluator used for some Hessian calculations has been (temporarily) dropped. This series of minor releases is compatible with Julia 1.12
1617

1718
## Contributing
1819

1920
Contributions are very welcome. Until clear guidelines and practices are established, we recommend to open an issue where the bugfix or enhancement can be discussed, before starting a pull request. We will do our best to respond in a timely manner.
2021

21-
## Quick Start
22+
## Quick Start for v0.10.x
2223

23-
- Install Julia 1.11
24+
- Versions after v0.10.x are registered in the General registry and are compatible with Julia 1.12
25+
- Install Julia 1.12
26+
- Create new folder a.g. `acetutorial`; Open a shell
27+
- Create a new project in `acetutorial` and install `ACEpotentials.jl`
28+
```
29+
julia --project=.
30+
]
31+
add ACEpotentials
32+
```
33+
- Install the Julia tutorials (this installs two Jupyter notebook tutorials)
34+
```julia-repl
35+
using ACEpotentials
36+
ACEpotentials.copy_tutorial()
37+
```
38+
- Work through the tutorials.
39+
40+
## Quick Start for v0.9.x
41+
42+
- Install Julia 1.11
2443
- Create new folder a.g. `acetutorial`; Open a shell
2544
- Create a new project in `acetutorial` and install `ACEpotentials.jl`
2645
```

docs/src/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ ACE models are defined in terms of body-ordered invariant features of atomic env
2424
### Key Dependencies
2525

2626
* [`Polynomials4ML.jl`](https://github.com/ACEsuit/Polynomials4ML.jl) : basic kernels for embeddings and tensors
27-
* [`EquivariantModels.jl`](https://github.com/ACEsuit/EquivariantModels.jl) : tools for equivariant model building
2827
* [`RepLieGroups.jl`](https://github.com/ACEsuit/RepLieGroups.jl) : coupling coefficients for equivariant tensors
2928
* [`ACEfit.jl`](https://github.com/ACEsuit/ACEfit.jl) : unified interface to various regression algorithms
3029
* [`AtomsBase.jl`](https://github.com/JuliaMolSim/AtomsBase.jl) : community interface for atomic structures / systems

docs/src/tutorials/asp.jl

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,38 +62,44 @@ omp_result = ACEfit.solve(solver_omp, Wt .* At, Wt .* yt, Wv .* Av, Wv .* yv);
6262
# We can select the final model, a model with 500 active parameters, and a model with a validation error within 1.3 times the minimum validation error.
6363
# We can use the `ACEfit.asp_select` function to select the desired models from the result.
6464

65-
asp_final = set_parameters!( deepcopy(model),
65+
asp_final = set_parameters!( deepcopy(model),
6666
ACEfit.asp_select(asp_result, :final)[1]);
67-
asp_size_50 = set_parameters!( deepcopy(model),
67+
asp_size_50 = set_parameters!( deepcopy(model),
6868
ACEfit.asp_select(asp_result, (:bysize, 50))[1]);
69-
asp_error13 = set_parameters!( deepcopy(model),
69+
asp_error13 = set_parameters!( deepcopy(model),
7070
ACEfit.asp_select(asp_result, (:byerror, 1.3))[1]);
7171

72-
pot_final = fast_evaluator(asp_final; aa_static = false);
73-
pot_50 = fast_evaluator(asp_size_50; aa_static = true);
74-
pot_13 = fast_evaluator(asp_error13; aa_static = true);
72+
# NOTE: fast_evaluator temporarily disabled due to incompatibility with
73+
# upstream SparseACEbasis (requires major refactoring)
74+
# pot_final = fast_evaluator(asp_final; aa_static = false);
75+
# pot_50 = fast_evaluator(asp_size_50; aa_static = true);
76+
# pot_13 = fast_evaluator(asp_error13; aa_static = true);
7577

76-
err_13 = ACEpotentials.compute_errors(test_data, pot_13);
77-
err_50 = ACEpotentials.compute_errors(test_data, pot_50);
78-
err_fin = ACEpotentials.compute_errors(test_data, pot_final);
78+
# Use the models directly for now
79+
err_13 = ACEpotentials.compute_errors(test_data, asp_error13);
80+
err_50 = ACEpotentials.compute_errors(test_data, asp_size_50);
81+
err_fin = ACEpotentials.compute_errors(test_data, asp_final);
7982

8083

8184
# Similarly, we can compute the errors for the OMP models.
8285

83-
omp_final = set_parameters!( deepcopy(model),
86+
omp_final = set_parameters!( deepcopy(model),
8487
ACEfit.asp_select(omp_result, :final)[1]);
85-
omp_50 = set_parameters!( deepcopy(model),
88+
omp_50 = set_parameters!( deepcopy(model),
8689
ACEfit.asp_select(omp_result, (:bysize, 50))[1]);
87-
omp_13 = set_parameters!( deepcopy(model),
90+
omp_13 = set_parameters!( deepcopy(model),
8891
ACEfit.asp_select(omp_result, (:byerror, 1.3))[1]);
8992

90-
pot_fin = fast_evaluator(omp_final; aa_static = false);
91-
pot_50 = fast_evaluator(omp_50; aa_static = true);
92-
pot_13 = fast_evaluator(omp_13; aa_static = true);
93+
# NOTE: fast_evaluator temporarily disabled due to incompatibility with
94+
# upstream SparseACEbasis (requires major refactoring)
95+
# pot_fin = fast_evaluator(omp_final; aa_static = false);
96+
# pot_50 = fast_evaluator(omp_50; aa_static = true);
97+
# pot_13 = fast_evaluator(omp_13; aa_static = true);
9398

94-
err_13 = ACEpotentials.compute_errors(test_data, pot_13);
95-
err_50 = ACEpotentials.compute_errors(test_data, pot_50);
96-
err_fin = ACEpotentials.compute_errors(test_data, pot_fin);
99+
# Use the models directly for now
100+
err_13 = ACEpotentials.compute_errors(test_data, omp_13);
101+
err_50 = ACEpotentials.compute_errors(test_data, omp_50);
102+
err_fin = ACEpotentials.compute_errors(test_data, omp_final);
97103

98104

99105
# Finally, we can visualize the results along the solution path.

src/ACEpotentials.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@ include("analysis/potential_analysis.jl")
2626
include("descriptor.jl")
2727

2828

29-
# TODO: to be completely rewritten
29+
# TODO: to be completely rewritten or retired
3030
# include("export.jl")
3131

32-
# Experimental
33-
# TODO: this is basically the UFACE interface which we need to revive
34-
# include("experimental.jl")
35-
3632

3733
# ----------------- Exports that seem important to make the tutorials work.
3834

src/experimental.jl

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/models/Rnl_basis.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
import LuxCore: AbstractExplicitLayer,
3-
initialparameters,
2+
import LuxCore: AbstractLuxLayer,
3+
initialparameters,
44
initialstates
55
using StaticArrays: SMatrix, SVector
66
using Random: AbstractRNG
@@ -27,7 +27,7 @@ const SPL_OF_SVEC{DIM, T} =
2727
}
2828

2929

30-
mutable struct LearnableRnlrzzBasis{NZ, TPOLY, TT, TENV, T} <: AbstractExplicitLayer
30+
mutable struct LearnableRnlrzzBasis{NZ, TPOLY, TT, TENV, T} <: AbstractLuxLayer
3131
_i2z::NTuple{NZ, Int}
3232
polys::TPOLY
3333
transforms::SMatrix{NZ, NZ, TT}
@@ -41,7 +41,7 @@ mutable struct LearnableRnlrzzBasis{NZ, TPOLY, TT, TENV, T} <: AbstractExplicitL
4141
end
4242

4343

44-
mutable struct SplineRnlrzzBasis{NZ, TT, TENV, LEN, T} <: AbstractExplicitLayer
44+
mutable struct SplineRnlrzzBasis{NZ, TT, TENV, LEN, T} <: AbstractLuxLayer
4545
_i2z::NTuple{NZ, Int}
4646
transforms::SMatrix{NZ, NZ, TT}
4747
envelopes::SMatrix{NZ, NZ, TENV}

0 commit comments

Comments
 (0)