API Reference

Tensor4allModule
Tensor4all

Tensor4all.jl is in an API-skeleton review phase.

The previous implementation has been intentionally removed so the package can be rebuilt against the design documents in docs/design/ without stale public surface area leaking into the rework. Importing the package is expected to work, but the real backend-facing types and operations are deferred to a later phase.

source

Core

Tensor4all.SkeletonPhaseErrorType
SkeletonPhaseError(message)

Raised when code expects functionality that is intentionally deferred during the review-first skeleton phase.

Examples

julia> using Tensor4all

julia> err = SkeletonPhaseError("not ready yet");

julia> sprint(showerror, err)
"not ready yet"
source
Tensor4all.SkeletonNotImplementedType
SkeletonNotImplemented(api, layer)

Raised by reviewable public APIs that are intentionally present before their backend behavior is implemented.

Examples

julia> using Tensor4all

julia> err = SkeletonNotImplemented(:contract, :core);

julia> sprint(showerror, err)
"Tensor4all skeleton phase: `contract` is planned in the `core` layer but not implemented yet."
source
Tensor4all.BackendUnavailableErrorType
BackendUnavailableError(message)

Raised when a backend-backed operation is requested but the tensor4all-rs shared library is not available.

Examples

julia> using Tensor4all

julia> err = BackendUnavailableError("backend missing");

julia> sprint(showerror, err)
"backend missing"
source
Tensor4all.backend_library_pathFunction
backend_library_path()

Return the expected path to the tensor4all-rs C API shared library.

This helper is backend-free and can be used during the skeleton phase to inspect where the package would look for the compiled library.

Examples

julia> using Tensor4all

julia> backend_library_path() isa String
true
source
Tensor4all.require_backendFunction
require_backend()

Load and return the tensor4all-rs shared library handle.

This function is part of the skeleton API surface, but it only succeeds when a compiled backend is available.

Examples

julia> require_backend()
ERROR: BackendUnavailableError(...)
source
Tensor4all.IndexType
Index(dim; tags=String[], plev=0, id=next_index_id(), backend_handle=nothing)

Create a Julia-side review skeleton for an indexed tensor leg.

The metadata behavior is implemented during the skeleton phase, while the optional backend handle keeps the public shape aligned with the eventual backend-facing design.

Examples

julia> using Tensor4all

julia> i = Index(4; tags=["x"], plev=1);

julia> (dim(i), tags(i), plev(i))
(4, ["x"], 1)
source
Tensor4all.simFunction
sim(i)

Return a similar index with matching metadata and a fresh identifier.

source
Tensor4all.primeFunction
prime(i, n=1)

Return i with its prime level increased by n.

source
prime(t, n=1)

Return t with all attached indices primed by n.

source
Tensor4all.commonindsFunction
commoninds(xs, ys)

Return the indices in xs that also occur in ys, preserving the order from xs.

source
Tensor4all.uniqueindsFunction
uniqueinds(xs, ys)

Return the indices in xs that do not occur in ys, preserving the order from xs.

source
Tensor4all.TensorType
Tensor(data, inds; backend_handle=nothing)

Create a tensor skeleton from Julia-owned dense array data and index metadata.

This constructor validates metadata and shape consistency during the skeleton phase. Backend-backed contraction and factorization behavior remains deferred.

Examples

julia> using Tensor4all

julia> i = Index(2; tags=["i"]);

julia> j = Index(3; tags=["j"]);

julia> t = Tensor(reshape(collect(1.0:6.0), 2, 3), [i, j]);

julia> (rank(t), dims(t))
(2, (2, 3))
source
Tensor4all.contractFunction
contract(a, b)

Placeholder for tensor contraction.

Examples

julia> contract(a, b)
ERROR: SkeletonNotImplemented(...)
source
contract(a, b)

Placeholder for backend-backed TreeTN contraction.

source

TreeTN

Tensor4all.TreeTensorNetworkType
TreeTensorNetwork(tensors; adjacency, siteinds, linkinds, backend_handle=nothing)

Create a TreeTN-general review skeleton from local tensor metadata and explicit topology maps.

The topology helpers are implemented during the skeleton phase, while numerical operations remain stub-only until backend integration.

Examples

julia> ttn = TreeTensorNetwork(...; adjacency=..., siteinds=..., linkinds=...)
source
Tensor4all.MPSType
MPS

Alias for TensorTrain. MPS-ness is a runtime structural property rather than a separate type.

source
Tensor4all.MPOType
MPO

Alias for TensorTrain. MPO-ness is a runtime structural property rather than a separate type.

source

Quantics

Adopted QuanticsGrids.jl Surface

The following names are re-exported through Tensor4all.jl for single-import usability, but their grid semantics and original documentation remain owned by QuanticsGrids.jl:

  • DiscretizedGrid
  • InherentDiscreteGrid
  • quantics_to_grididx
  • quantics_to_origcoord
  • grididx_to_quantics
  • grididx_to_origcoord
  • origcoord_to_quantics
  • origcoord_to_grididx
Tensor4all.QuanticsTransformType
QuanticsTransform(kind, parameters)

Metadata-only descriptor for a planned quantics transform.

The descriptor is reviewable during the skeleton phase, while transform materialization remains backend-backed and therefore stub-only.

source
Tensor4all.QTCIOptionsType
QTCIOptions(; tolerance=1.0e-8, max_rank=64, max_sweeps=10)

Metadata-only placeholder for future QTCI configuration.

source