Skip to content

Releases: JuliaGNI/GeometricBrackets.jl

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 20:50

GeometricBrackets v0.3.0

Diff since v0.2.0

A PoissonTensor now wraps a rank-3 array instead of building one from a bracket, and
PoissonOperator follows that tensor's own stencil. Both break callers, so this is 0.3.0.

Breaking Changes

  • PoissonTensor wraps a rank-3 array. It is a DiscreteBracket around an
    AbstractArray{DT, 3} whose extents agree and whose axes are 1:N; a wrapped GridTensor
    carries the grid. The fields nx, nv and f are gone, and its parameters are {DT, TT} —
    TT is the array's type. Non-cubic extents throw a DimensionMismatch, offset axes an
    ArgumentError. PoissonTensor{DT, Arakawa{DT}} no longer forms, so
    PoissonTensor{Float64, Arakawa{Float64}} throws a TypeError.
    PoissonTensor(DT, nx, nv, f) still builds the tensor of a bracket on an nx × nv grid.
  • PoissonOperator sums over the stencil of its tensor, not a fixed 3 × 3 loop.
  • MultiIndexArrays is a dependency again, for the GridTensor a PoissonTensor wraps.

Added

  • poisson_apply!(Pc, b, û, c) writes the product of poisson_apply into Pc and returns it,
    for every DiscreteBracket. Only Arakawa writes Pc directly and allocates nothing on
    Vectors, so a time step can call it repeatedly; any other bracket copies and allocates. Pc
    takes any element type the result converts to, as with mul!. A wrong length throws a
    DimensionMismatch, and for Arakawa a Pc sharing memory with û or c an ArgumentError.
  • poisson_matrix, poisson_apply and poisson_derivative on a PoissonTensor.
    poisson_matrix gives the bracket's matrix at a state û, poisson_derivative the tensor
    itself, which is constant, and poisson_apply is matrix-free.

Changed

  • [compat] CairoMakie is "0.15", from "0.12, 0.13, 0.14, 0.15": only 0.15 is tested and
    0.12 fails to precompile on Julia 1.13. [compat] StaticArrays is "1.9.13", from "1", the
    floor SimpleSolvers 0.14.1 already requires.
  • Pkg.test() no longer runs the doctests. test/quality/doctests.jl is the group doctests;
    Pkg.test(test_args = ["doctests"]) runs it, and CI keeps the Doctests job as their runner.

Fixed

  • PoissonOperator(tensor, h) has the element type promote_type(eltype(tensor), eltype(h)).
    In 0.2.0 a Float32 tensor with a Float64 Hamiltonian rounded its values, and a Float64 tensor
    with a complex one made Matrix(po) throw InexactError.
  • The docs no longer say every bracket is skew-symmetrised. A ConstantBracket built from a
    given matrix and a PoissonTensor are antisymmetric only if what they are given is. This fixes
    K7, and the jacobi_residual docstring now says its cyclic sum is the Jacobiator only for an
    antisymmetric matrix.

Merged pull requests:

  • CI: coverage from Julia 1 on ubuntu, save the cache only from a job that succeeds (#34) (@michakraus)
  • Move the doctests into their own test group (#35) (@michakraus)
  • Move the top-level test files that mirror no source file (#36) (@michakraus)
  • PoissonTensor wraps a rank-3 tensor, and PoissonOperator follows its stencil (#37) (@michakraus)
  • Restrict the CairoMakie compat bound to 0.15 (#38) (@michakraus)
  • Say which brackets are skew-symmetrised, and add a PoissonTensor row (#39) (@michakraus)
  • Add poisson_apply! for Arakawa, the in-place form of poisson_apply (#40) (@michakraus)
  • Raise the StaticArrays compat floor to 1.9.13 (#41) (@michakraus)

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 03 Oct 10:24

GeometricBrackets v0.2.0

Diff since v0.1.2

The two PoissonTensor checks under Breaking Changes reject input that 0.1.2 accepts, so this release is 0.2.0. A package that builds a PoissonTensor from an Arakawa of another element type has to change that call before it allows 0.2.

Breaking Changes

  • PoissonTensor(DT, nx, nv, f) throws a DimensionMismatch when f is an Arakawa on a grid other than nx × nv. Before, it built the tensor, and its entries were wrong with no error: the Arakawa wrapped its offsets on its own grid, not on the grid of the tensor.
  • PoissonTensor(DT, nx, nv, f) throws an ArgumentError when f is an Arakawa whose element type is not DT. Before, PoissonTensor(Float32, …, Arakawa{Float64}) gave Float64 entries, and a PoissonOperator on it was an AbstractMatrix{Float32} with Float64 entries.

Changed

  • The floors rise to GeometricBase 0.15.0, CompactBasisFunctions 0.4.2, QuadratureRules 0.2.2, SimpleSolvers 0.14.1 and SimpleSplines 0.3.1, because GeometricBase 0.15 declares its stubs public and requires Julia 1.11.
  • The test suite mirrors src/, uses the groups core and slow, and has its environment in test/Project.toml; a new test/quality/doctests.jl runs the doctests. The test count is unchanged.
  • test/Project.toml and docs/Project.toml no longer repeat a [compat] bound of Project.toml.
  • Unused bindings in the tests and a keyword spelling in src/integrators.jl are cleaned up; no behaviour changes.

Merged pull requests:

  • Migrate the test suite to SafeTestsets groups (part M11) (#22) (@michakraus)
  • Check the Arakawa grid and element type in the PoissonTensor constructor (#23) (@michakraus)
  • Update SimpleSolvers requirement to 0.14.0 in /docs (#24) (@dependabot[bot])
  • Update CompactBasisFunctions requirement to 0.4.1 in /docs (#25) (@dependabot[bot])
  • Update Documenter requirement to 1.19.0 in /test (#27) (@dependabot[bot])
  • Update Aqua requirement to 0.8.18 in /test (#28) (@dependabot[bot])
  • Keep the SymPy == true comparison, suppress lint (#29) (@michakraus)
  • Remove the compat entries that test and docs share with the root (#30) (@michakraus)
  • Clear the remaining fatou findings in src (#31) (@michakraus)
  • Delete three unused test bindings (fatou part R7) (#32) (@michakraus)
  • Raise the floors to GeometricBase 0.15.0 and set version 0.2.0 (#33) (@michakraus)

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 24 Sep 14:15

GeometricBrackets v0.1.2

Diff since v0.1.1

This patch release changes and removes API because 0.1.1 was released the same day,
and no package outside this repository depends on these names in a registered release.

Fixed

Arakawa(nx, nv, hx, hv) accepts spacings of any Real types; the element type is
that of inv(hx) * inv(hv) / 12. In 0.1.1 integer spacings threw InexactError and
mixed types a MethodError.

Changed

  • PoissonTensor and PoissonOperator indexing off the grid throws BoundsError
    (was AssertionError from @assert, which may be compiled out). Both the
    CartesianIndex and the linear-index methods of PoissonTensor check;
    PoissonOperator uses checkbounds.
  • PoissonOperator(tensor, h) throws DimensionMismatch when length(h) is not
    nx * nv.
  • Array(pt) materialises a PoissonTensor, and Matrix(po) a PoissonOperator
    (it is an AbstractMatrix). The two Base.materialize methods are removed,
    because Base.materialize is not public Base API. Note for callers:
    Base.materialize(x) now falls back to Base's identity and returns the lazy
    object itself rather than an error.
  • _apply_P_h! and _apply_P_ϕ! are no longer exported (leading-underscore
    internals; reach them as GeometricBrackets._apply_P_h! or by explicit using GeometricBrackets: _apply_P_h!). This also removes the name clash with
    ReducedBasisMethods, which exports the same names in its released versions.
    PoissonTensor and PoissonOperator stay exported and now have docstrings, shown
    on the library page.
  • _apply_P_h! throws DimensionMismatch unless Pf, f and h have length
    nx * ny, the number of grid nodes, and ArgumentError if any input has
    non-1-based indexing. It checked only that the three lengths were equal, so its
    @inbounds loop read and wrote past the end of equally short vectors. The
    tests cover the length checks of _apply_P_h! and _apply_P_ϕ!.
  • poisson_apply(::Arakawa, û, c) evaluates hx·hv·[c, û] with _apply_P_h!;
    same values to rounding, about two orders of magnitude faster at n = 64 and n = 256,
    allocating only its output.
  • size(::PoissonTensor) infers a concrete NTuple{3, Int}; PoissonOperator
    indexing no longer allocates a neighbour vector per entry.

Removed

  • Dependencies OffsetArrays and MultiIndexArrays. The Arakawa sign tables are
    one plain Array{Int,4} (their sum, the only way they were read); the 3 × 3
    periodic stencil of PoissonOperator and the linear-to-Cartesian conversion are
    written in the package with CartesianIndices, so no non-public name of another
    package is used.
  • The uncalled helpers inc, dec and the collision stencils _apply_C!,
    _apply_Cρ!, _apply_Cρ²!, _apply_Δᵥ! (never exported, no caller, no test).

Corrections to the 0.1.1 entry

  • PoissonTensor/PoissonOperator are not a "weak form": PoissonOperator * g is
    the bracket at the grid nodes with no hx·hv quadrature weight. PoissonTensor
    holds T with [g, h]_I = Σ_{J,K} T[I,J,K] g_J h_K.
  • The Jacobi band "0.50–0.74 over 40 random states" is one sample; the
    state-independent figure is structure_constant_residual(poisson_derivative(b, û)) == 0.5 on n × n grids, n = 5..8, now asserted in the tests.
  • "a test on a 5 × 3 grid pins every index bound" overstated the coverage in 0.1.1;
    the tests now cover every index check of both types.

Tests added: real-typed spacings, _apply_P_ϕ! against _apply_P_h!, the 0.5
structure-constant residual, Array(pt) contracted against the independent Jacobian,
and the BoundsError/DimensionMismatch cases.

Merged pull requests:

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 24 Sep 09:36

GeometricBrackets v0.1.1

Diff since v0.1.0

Added — the grid-based Arakawa bracket, a DiscreteBracket on a finite-difference grid

Moved in from ReducedBasisMethods' src/gridbased/. Three files arrive:

  • src/arakawa.jl — Arakawa(nx, nv, hx, hv), Arakawa's discretisation of the canonical
    bracket on a doubly periodic nx × nv grid. It is a DiscreteBracket in Lie-Poisson form,
    P(f)_{JK} = hx·hv·Σ_I f_I A(I,J,K), linear in the grid state: poisson_apply contracts the
    3 × 3 stencil and assembles no matrix, and poisson_derivative is the constant tensor
    hx·hv·A. The assembled matrix satisfies P == -P' bit for bit. The Jacobi identity does
    not hold: jacobi_residual is of order one and flat under refinement, 0.50–0.74 over 40
    random states on grids of 5 to 8 nodes a side. Called as arakawa(I, J, K), it returns the
    stencil coefficient that one passes to PoissonTensor as its f. The constructor refuses a
    grid with fewer than 3 nodes in a direction, where the two neighbours of a node coincide.
  • src/poisson_tensors.jl — PoissonTensor, an N × N × N tensor discretising the weak
    form of g[f,h] on an nx × nv phase-space grid, and PoissonOperator, the weak form of
    f ↦ [f,h] for a fixed Hamiltonian. Both index lazily through a stencil, so neither
    materialises until Base.materialize is called.
  • src/bracket_operators.jl — _apply_P_h! and _apply_P_ϕ!, the same bracket applied
    matrix-free to a vector, plus the Lenard-Bernstein-style collision stencils _apply_C!,
    _apply_Cρ!, _apply_Cρ²! and _apply_Δᵥ! that shared the file.

The bodies in poisson_tensors.jl and bracket_operators.jl are byte-identical to their
source, except the three index assertions of PoissonTensor, which test
I in CartesianIndices((nx, nv)) where the source called a pirated Base.isvalid.

New dependencies: OffsetArrays, for the Arakawa sign tables, and MultiIndexArrays 0.1.1
(JuliaGNI/MultiIndexArrays.jl#2), which owns multiindex and _stencil_indices. Its
linearindex bounds the second component by nv, where the ReducedBasisMethods copy
checked i ≤ nv; a test on a 5 × 3 grid pins every index bound.

No type piracy: Aqua's check is clean, and the two Base.materialize overloads dispatch on
the package's own types.

Merged pull requests:

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 24 Sep 07:36

GeometricBrackets v0.1.0

Initial release

First registered release. GeometricBrackets provides structure-preserving discretisations of
the Poisson, metric and metriplectic brackets of Hamiltonian partial differential equations:
discrete function spaces, brackets with a common poisson_matrix / jacobi_residual interface,
discrete Hamiltonians and Casimirs, geometric integrators, and diagnostics.

The package was developed in the open against main and never carried a released version before
this one, so this release is everything in the changelog. Its section runs to some 1600 lines —
well past what a comment holds — so it is indexed here and reproduced in full at
CHANGELOG.md.

What this release contains

  • Added — pinv inverts the torus derivative on the modes that have one
  • Changed — the package is renamed to GeometricBrackets
  • Changed — the export list says which names are the interface
  • Fixed — a conditional whose branches were identical
  • Changed — the memoised tables say they are the cache
  • Added — a testset for the one-axis TensorSplineSpace
  • Added — an Aqua baseline, which this package had never had
  • Fixed — CollisionBracket is now frame-covariant on a mapped domain
  • Added — PulledBack, mapped domain pullback onto the parameter space
  • Added — PolarSplineSpace, a DiscreteSpace on a parameter square with a pole
  • Changed — CollisionBracket takes any planar spline space
  • Fixed — the [sources] comments promised a retirement a version bump does not earn
  • Changed — scripts/check.jl drops its two failure-list accessors
  • Fixed — the SimpleSplines compat bound, after its 0.1.0 release
  • Changed — the Julia floor is 1.11, which is what [sources] has always required
  • Fixed — scripts/ resolves SimpleSolvers from the registry
  • Added — MetriplecticFlow, and AbstractFlow under both kinds of flow
  • Added — CollisionBracket, the §5.2 collision-like bracket, collapsed
  • Added — MetricBracket, the symmetric half of a metriplectic structure
  • Added — TensorSplineSpace, a tensor-product DiscreteSpace
  • Added — verify_metric_collapse.jl
  • Fixed — section 7 measured its denominator bound on too small a set
  • Fixed — the Julia/Python agreement table read as a live claim
  • Tracks the reshaped SimpleSplines
  • Added — Nambu's Liouville criterion, as section 7 of verify_kdv_nambu.jl
  • Added — verify_zeitlin_three_bracket.jl
  • Fixed — checks in the fable scripts that could not fail
  • Added — a driver for the fable scripts
  • Added — an adversarial re-check of the structure-function bracket
  • Added — an adversarial re-check of the matrix structure-function bracket
  • Added — shared verification machinery for the fable branch
  • Added — Vlasov–Poisson on a bounded domain as Lie-Poisson on u(N)*
  • Added — semidirect-product brackets via pointwise flat coordinates
  • Added — the structure-function bracket on T^{2n}
  • Added — the matrix structure-function bracket on gl(N)
  • Added — multi-field structure functions, and derivative dependence
  • Added — the four-bracket manuscript
  • Changed — scripts/check.jl learned the convergence idiom
  • Fixed — a relative [sources] path does not compose
  • The mixed two-field formulation
  • K0 is no longer densified
  • kernel_operator
  • The linear solver for the mixed system is a correctness constraint
  • Requires SimpleSolvers 0.13
  • Changed — the KdV sign convention is now the textbook one
  • Added — a spectral parameter for the Miura chart
  • Changed — LagrangeSpace stores its tabulation sparsely
  • Removed — the local LapackLU
  • Fixed
  • Added — documentation
  • The RK4 question
  • Added — the initial feature set
  • The Newton residual tolerance
  • Performance

Merged pull requests:

  • Verify the three-bracket mechanism on the Zeitlin truncation (#1) (@michakraus)
  • Verification scripts from the fable-brackets investigation (#2) (@michakraus)
  • Update to the reshaped SimpleSplines (#3) (@michakraus)
  • Add Nambu's Liouville criterion to verify_kdv_nambu.jl (#4) (@michakraus)
  • Add the metric-bracket half: MetricBracket, CollisionBracket, TensorSplineSpace and MetriplecticFlow (#5) (@michakraus)
  • Measure section 7's denominator bound on the right set (#6) (@michakraus)
  • Follow SimpleSplines 0.1.0 in the compat bound (#7) (@michakraus)
  • Drop the check harness's dead failure accessors (#8) (@michakraus)
  • Say registered, not released, in [sources] (#9) (@michakraus)
  • CompatHelper: bump compat for SimpleSplines to 0.2, (keep existing compat) (#10) (@github-actions[bot])
  • CompatHelper: bump compat for SimpleSolvers to 0.14, (keep existing compat) (#11) (@github-actions[bot])
  • CompatHelper: bump compat for CompactBasisFunctions to 0.4, (keep existing compat) (#12) (@github-actions[bot])
  • Add the polar discrete space and the mapped-domain pullback (#13) (@michakraus)
  • Read the physical frame in CollisionBracket (#14) (@michakraus)
  • Close the metric-bracket review follow-ups: exports, shared generics, an Aqua baseline and the CHANGELOG fold (#16) (@michakraus)
  • Add a pseudoinverse for the torus derivative (#17) (@michakraus)