RoughPy reference
- class roughpy.ChannelType
Members:
IncrementChannel
ValueChannel
CategoricalChannel
LieChannel
- CategoricalChannel = <ChannelType.CategoricalChannel: 2>
- IncrementChannel = <ChannelType.IncrementChannel: 0>
- LieChannel = <ChannelType.LieChannel: 3>
- ValueChannel = <ChannelType.ValueChannel: 1>
- property name
- property value
- class roughpy.Context
A
Contexts
allows us to provide awidth
,depth
, and acoefficient
field for aTensor
. They also provide access to the Baker-Campbell-Hausdorff formula. They are the environment in which calculations are done. They are used everywhere in RoughPy, for anyStream
or algebraic object.- cbh()
Computes the Campbell-Baker-Haussdorff product of a number of
Lie
elements within thatContext
, using the truncation levels.Lie
objects need to have the samewidth
, but truncation level might differ.
- ctype
Coefficient type. One of
SPReal
,DPReal
,Rational
,PolyRational
.
- depth
Maximum degree for
Lie
objects,FreeTensor
objects, etc. (deprecated, usectx
instead).
- lie_size()
A shortcut for
lie_basis.size()
.
- lie_to_tensor()
Linear embedding of the
Lie
algebra into theFreeTensor
algebra.
- tensor_basis
An instance of
TensorBasis
with theContext
‘swidth
anddepth
.
- tensor_size()
A shortcut for
tensor_basis.size()
.
- tensor_to_lie()
Linear embedding of the
FreeTensor
algebra into theLie
algebra.
- to_logsignature()
Takes some argument (
signature
), equivalent totensor_to_lie(signature.log())
.
- width
Alphabet size, dimension of the underlying space (deprecated, use
ctx
instead).
- class roughpy.DPReal
- class roughpy.DateTimeInterval
An
Interval
which describes a region of time.- dt_inf(self: roughpy._roughpy.DateTimeInterval) object
- dt_sup(self: roughpy._roughpy.DateTimeInterval) object
- class roughpy.Dyadic
A dyadic rational number.
- static dyadic_equals(lhs: roughpy._roughpy.Dyadic, rhs: roughpy._roughpy.Dyadic) bool
Check if two dyadic rationals are equivalent, \(k_1=k_2\), \(n_1=n_2\).
- property k
- property n
- static rational_equals(lhs: roughpy._roughpy.Dyadic, rhs: roughpy._roughpy.Dyadic) bool
Check if \(\frac{k_1}{2^{n_1}} = \frac{k_2}{2^{n_2}}\) as rational numbers, e.g. \(\frac{2}{2^1} = \frac{1}{2^0}\) as rationals, but not as dyadics, as neither \(k_1=k_2\) nor \(n_1=n_2\).
- rebase(self: roughpy._roughpy.Dyadic, resolution: int) bool
- class roughpy.DyadicInterval
A dyadic interval.
- dyadic_excluded_end()
If the
Interval
type isclopen
, returns the supremum. If theInterval
isopencl
, returns the infimum.
- dyadic_included_end()
If the
Interval
type isclopen
, returns the infimum. If theInterval
isopencl
, returns the supremum.
- dyadic_inf()
Returns the infimum of a
DyadicInterval
.
- dyadic_sup()
Returns the supremum of a
DyadicInterval
.
- shrink_to_contained_end()
Same as
shrink_interval()
functions, but aware of the type (clopen
,opencl
).
- shrink_to_omitted_end()
Same as
shrink_interval()
functions, but aware of the type (clopen
,opencl
).
- static to_dyadic_intervals()
Dissect an
Interval
into aPartition
ofDyadicInterval
objects.
- class roughpy.ExternalDataStream
A
Stream
that acquires itsdata
dynamically from an external source.- static from_uri()
- class roughpy.FreeTensor
Element of the (truncated) tensor algebra.
A
FreeTensor
object supports arithmetic operators, providing both objects are compatible, along with comparison operators. The multiplication operator for this class is the free tensor multiplication (concatenation of tensor words). Moreover,FreeTensor
objects are iterable, where the items are tuples ofTensorKey
andfloat
corresponding to the non-zero elements of theFreeTensor
.The class also supports (implicit and explicit) conversion to a Numpy array type, so it can be used as an argument to any function that takes Numpy arrays. The array representation of a
FreeTensor
is one-dimensional. Alternatively, one can construct d-dimensional arrays containing the elements of degree d by using thedegree_array()
method.There are methods for computing the tensor exponential,
exp()
, logarithm,log()
, and the antipode,antipode()
. See the documentation of these methods for more information.A tensor can be created from an array-like object containing the coefficients of the keys, in their standard order. Since tensors must be created with both an alphabet size and depth, we need to provide at least the
depth
argument. However, it is recommended that you also provided thewidth
argument, otherwise it is assumed that the tensor has degree 1 and the alphabet size will be determined from the length of the argument.>>> ts1 = rp.FreeTensor([1.0, 2.0, 3.0], depth=2) >>> print(ts1) { 1() 2(1) 3(2) } >>> ts2 = rp.FreeTensor([1.0, 2.0, 3.0], width=2, depth=2) >>> print(ts2) { 1() 2(1) 3(2) }
If the width argument is provided, this construction can be used to construct
FreeTensor
objects of any degree, up to the maximum. TheContext
class provides a methodtensor_size()
that can be used to get the dimension of the tensor up to a given degree.- add_mul()
Adds to the instance a product of algebra instances.
- add_scal_div()
A version of \(+=\) fused with rational division.
- add_scal_mul()
A version of \(+=\) fused with scalar multiplication.
- antipode()
Compute the antipode of a
FreeTensor
instance
- property context
Provide an algebra context in which to create the algebra.
- degree()
Less than or equal to
depth
, not fixed, measure of what we have.
- dimension()
The number of elements that are represented by the vector.
- property dtype
Scalar type for the algebra (deprecated, use
ctx
instead). Can be a RoughPy data type (SPReal
,DPReal
,Rational
,PolyRational
), or a numpy dtype.
- exp()
Computes the truncated exponential of a
FreeTensor
instance.
- fmexp()
Fused multiply exponential operation for
FreeTensor
objects. Computes \(a exp(x)\).
- is_zero()
Bool, checks if empty, i.e. all coefficients are zero.
- log()
Computes the truncated log of the argument up to degree
max_degree
- property max_degree
Set out by the basis, i.e.
depth
.
- mul_sdiv()
Multiply and scalar divide.
- mul_smul()
Multiply and scalar multiply.
- size()
Total number of non-zero elements represented by the vector, measure of sparsity.
- property storage_type
sparse
ordense
- sub_mul()
Subtracts to the instance a product of algebra instances.
- sub_scal_div()
A version of \(-=\) fused with rational division.
- sub_scal_mul()
A version of \(-=\) fused with scalar multiplication.
- property width
Alphabet size, dimension of the underlying space (deprecated, use
ctx
instead).
- class roughpy.FreeTensorIteratorItem
- class roughpy.FunctionStream
A stream generated dynamically by calling a function.
- static from_function()
- class roughpy.HPReal
- class roughpy.Interval
Interval
objects are used to query aStream
to get asignature()
or alog_signature()
. They are a time-like axis which is closed on the left, open on the right, e.g. \([0,1)\).RoughPy is very careful in how it works with intervals.
One design goal is that it should be able to handle jumps in the underlying signal that occur at particular times, including the beginning or end of the
Interval
, and still guarantee that if you combine thesignature()
over adjacentInterval
, you always get thesignature()
over the entireInterval
. This implies that there has to be a decision about whether data at the exact beginning or exact end of theInterval
is included.The convention in RoughPy are that we use clopen intervals, and that data at beginning of the
Interval
is seen, and data at the end of theInterval
is seen in the nextInterval
. A second design goal is that the code should be efficient, and so the internal representation of aStream
involves caching thesignature()
over dyadic intervals of different resolutions. Recovering thesignature()
over anyInterval
using the cache has logarithmic complexity (using at most \(2n\) tensor multiplications, when \(n\) is the internal resolution of theStream
. Resolution refers to the length of the finest granularity at which we will store information about the underlying data.Any event occurs within one of these finest granularity intervals, multiple events occur within the same
Interval
resolve to a more complexlog_signature()
which correctly reflects the time sequence of the events within this grain of time. However, no query of theStream
is allowed to see finerresolution
than the internalresolution
of theStream
, it is only allowed to access the information overInterval
objects that are a union of these finestresolution
granular intervals. For this reason, a query over anyInterval
is replaced by a query is replaced by a query over anInterval
whose endpoints have been shifted to be consistent with the granularresolution
, obtained by rounding these points to the contained end-point of the unique clopen granularInterval
containing this point. In particular, if both the left-hand and right-hand ends of theInterval
are contained in the clopen granularInterval
, we round theInterval
to the emptyInterval
. Specifying aresolution
of \(32\) or \(64\) equates to using respective integer arithmetic.We can create an
Interval
to query aStream
over, for example to compute asignature()
, in the following way. The example below is the interval \([0,1)\), over the Reals.interval = rp.RealInterval(0, 1)
Note
Clopen is currently the only supported interval type.
- contains()
Takes either a number, tells you if it’s there or not, OR takes an
Interval
, tells you if thatInterval
is fully contained in the otherInterval
.
- excluded_end()
If the
Interval
type isclopen
, returns the supremum. If theInterval
isopencl
, returns the infimum.
- included_end()
If the
Interval
type isclopen
, returns the infimum. If theInterval
isopencl
, returns the supremum.
- property interval_type
- class roughpy.IntervalType
Either
clopen
oropencl
, although onlyclopen
supported currently.Members:
Clopen
- Clopen = <IntervalType.Clopen: 0>
- property name
- property value
- class roughpy.Lie
Lie elements live in the free Lie Algebra. Group-like elements have a one-to-one correspondence with a
Stream
. That is, for every group-like element, there exists aStream
where thesignature()
of thatStream
is the group-like element. For more information on Lie Algebras, see Reutenauer and Bourbaki.You will most commonly encounter
Lie
objects when taking thelog_signature()
of a path. We can use the Dynkin map to transfer betweenLie
andsignature
objects.To construct a
Lie
, you will needdata
. For example, we can construct aLie
using a list of polynomials.>>> lie_data_x = [ 1 * roughpy.Monomial("x1"), # channel (1) 1 * roughpy.Monomial("x2"), # channel (2) 1 * roughpy.Monomial("x3"), # channel (3) 1 * roughpy.Monomial("x4"), # channel ([1, 2]) 1 * roughpy.Monomial("x5"), # channel ([1, 3]) 1 * roughpy.Monomial("x6"), # channel ([2, 3]) ] >>> lie_x = rp.Lie(lie_data_x, width=3, depth=2, dtype=rp.RationalPoly) >>> print(f"{lie_x=!s}") lie_x={ { 1(x1) }(1) { 1(x2) }(2) { 1(x3) }(3) { 1(x4) }([1,2]) { 1(x5) }([1,3]) { 1(x6) }([2,3]) }
You will also need to provide the following parameters:
ctx
Provide an algebra context in which to create the algebra, takes priority over the next 3.
Or
dtype
Scalar type for the algebra (deprecated, use
ctx
instead). Can be a RoughPy data type (rp.SPReal
,rp.DPReal
,rp.Rational
,rp.PolyRational
), or a Numpy dtype.depth
Maximum degree for
Lie
andFreeTensor
objects, etc. (deprecated, usectx
instead)width
Alphabet size, dimension of the underlying space (deprecated, use
ctx
instead)
Optional parameters:
vector_type
dense
orsparse
keys
List/array of
keys
to go along with scalars provided as an array argument.
- add_mul()
Adds to the instance a product of algebra instances.
- add_scal_div()
A version of \(+=\) fused with rational division.
- add_scal_mul()
A version of \(+=\) fused with scalar multiplication.
- property context
Provide an algebra context in which to create the algebra.
- degree()
Less than or equal to
depth
, not fixed, measure of what we have.
- dimension()
The number of elements that are represented by the vector.
- property dtype
Scalar type for the algebra (deprecated, use
ctx
instead). Can be a RoughPy data type (SPReal
,DPReal
,Rational
,PolyRational
), or a numpy dtype.
- is_zero()
Bool, checks if empty, i.e. all coefficients are zero.
- property max_degree
Set out by the basis, i.e.
depth
.
- mul_sdiv()
Multiply and scalar divide.
- mul_smul()
Multiply and scalar multiply.
- size()
Total number of non-zero elements represented by the vector, measure of sparsity.
- property storage_type
sparse
ordense
- sub_mul()
Subtracts to the instance a product of algebra instances.
- sub_scal_div()
A version of \(-=\) fused with rational division.
- sub_scal_mul()
A version of \(-=\) fused with scalar multiplication.
- property width
Alphabet size, dimension of the underlying space (deprecated, use
ctx
instead).
- class roughpy.LieBasis
- property depth
Truncation level
- property dimension
The number of elements represented by the vector.
- index_to_key(self: roughpy._roughpy.LieBasis, index: int) roughpy._roughpy.LieKey
Takes an integer and returns a
key
at that index.
- key_to_index(self: roughpy._roughpy.LieBasis, key: roughpy._roughpy.LieKey) int
Takes a
key
and returns an integer corresponding to the index.
- parents(self: roughpy._roughpy.LieBasis, key: roughpy._roughpy.LieKey) tuple[int | None, int | None]
Splits off the first letter and returns the letter and the remainder of the word.
- size(self: roughpy._roughpy.LieBasis, arg0: int) int
How big the dimension will be at a particular degree.
- property width
Alphabet size
- class roughpy.LieIncrementStream
A basic
Stream
type defined by a sequence of increments of fixed size at specified time intervals.- static from_increments()
- class roughpy.LieIteratorItem
-
- value(self: roughpy._roughpy.LieIteratorItem) roughpy._roughpy.Scalar
- class roughpy.LieKey
Same as a
TensorKey
, Hall word, element of the Hall basis for the freeLie
algebra.
- class roughpy.LieKeyIterator
Iterator over range of Hall set members.
- class roughpy.Partition
An
Interval
into which there are a number of intermediate points which represent the end points of sub intervals. Partition of anInterval
in the real line.- insert_intermediate(self: roughpy._roughpy.Partition, arg0: float) None
Cuts one of the intermediate intervals in half.
- intermediates(self: roughpy._roughpy.Partition) list[float]
List of intermediate end points.
- merge(self: roughpy._roughpy.Partition, arg0: roughpy._roughpy.Partition) roughpy._roughpy.Partition
The union of the partitions.
- mesh(self: roughpy._roughpy.Partition) float
Length of the largest sub interval.
- refine_midpoints(self: roughpy._roughpy.Partition) roughpy._roughpy.Partition
Inserts the midpoint between all of the intermediates.
- class roughpy.PiecewiseAbelianStream
A stream formed of a sequence of interval-Lie pairs.
- static construct()
- roughpy.PolynomialScalar
alias of
Polynomial
- class roughpy.Rational
- class roughpy.RationalPoly
- class roughpy.SPReal
- class roughpy.ScalarMeta
Scalar meta class
- class roughpy.ScalarTypeBase
Base class for scalar type
- class roughpy.ShuffleTensor
Element of the shuffle tensor algebra.
ShuffleTensor
objects are one way of representing the linear functionals onFreeTensor
objects. The shuffle product corresponds to point-wise multiplication of the continuous functions on paths via the signature correspondence. For more information on shuffle tensors, see Reutenauer, Free Lie Algebras.Shuffle tensors are useful because they represent functions on paths via the
signature()
.You can construct
ShuffleTensor
objects in the following way, here we use polynomial coefficients:>>> shuffle_tensor = ShuffleTensor([1 * Monomial(f"x{i}") for i in range(7)], width=2, depth=2, dtype=roughpy.RationalPoly)
Which would look like this:
{ { 1(x0) }() { 1(x1) }(1) { 1(x2) }(2) { 1(x3) }(1,1) { 1(x4) }(1,2) { 1(x5) }(2,1) { 1(x6) }(2,2) }
You construct with data, which for the example above was the following list:
[{ 1(x0) }, { 1(x1) }, { 1(x2) }, { 1(x3) }, { 1(x4) }, { 1(x5) }, { 1(x6) }]
As well as data, you will need to provide the following parameters:
ctx
Provide an algebra context in which to create the algebra, takes priority over the next 3.
Or
dtype
Scalar type for the algebra (deprecated, use
ctx
instead). Can be a RoughPy data type (rp.SPReal
,rp.DPReal
,rp.Rational
,rp.PolyRational
), or a Numpy dtype.depth
Maximum degree for
Lie
objects,FreeTensor
objects, etc. (deprecated, usectx
instead)width
Alphabet size, dimension of the underlying space (deprecated, use
ctx
instead)
Optional parameters:
vector_type
dense
orsparse
keys
List/array of
keys
to go along with scalars provided as an array argument.
You can shuffle two tensors together, using
*
. For example, usingx
andy
for indeterminate names forshuffle_tensor1
andshuffle_tensor2
, for the above tensor we could do:>>> result = shuffle_tensor1*shuffle_tensor2
The result would look like this:
result={ { 1(x0 y0) }() { 1(x0 y1) 1(x1 y0) }(1) { 1(x0 y2) 1(x2 y0) }(2) { 1(x0 y3) 2(x1 y1) 1(x3 y0) }(1,1) { 1(x0 y4) 1(x1 y2) 1(x2 y1) 1(x4 y0) }(1,2) { 1(x0 y5) 1(x1 y2) 1(x2 y1) 1(x5 y0) }(2,1) { 1(x0 y6) 2(x2 y2) 1(x6 y0) }(2,2) }
- add_mul()
Adds to the instance a product of algebra instances.
- add_scal_div()
A version of \(+=\) fused with rational division.
- add_scal_mul()
A version of \(+=\) fused with scalar multiplication.
- property context
Provide an algebra context in which to create the algebra.
- degree()
Less than or equal to
depth
, not fixed, measure of what we have.
- dimension()
The number of elements that are represented by the vector.
- property dtype
Scalar type for the algebra (deprecated, use
ctx
instead). Can be a RoughPy data type (SPReal
,DPReal
,Rational
,PolyRational
), or a numpy dtype.
- is_zero()
Bool, checks if empty, i.e. all coefficients are zero.
- property max_degree
Set out by the basis, i.e.
depth
.
- mul_sdiv()
Multiply and scalar divide.
- mul_smul()
Multiply and scalar multiply.
- size()
Total number of non-zero elements represented by the vector, measure of sparsity.
- property storage_type
sparse
ordense
- sub_mul()
Subtracts to the instance a product of algebra instances.
- sub_scal_div()
A version of \(-=\) fused with rational division.
- sub_scal_mul()
A version of \(-=\) fused with scalar multiplication.
- property width
Alphabet size, dimension of the underlying space (deprecated, use
ctx
instead).
- class roughpy.ShuffleTensorIteratorItem
- class roughpy.Stream
A
Stream
means an object that provides thesignature()
orlog_signature()
over anyInterval
. For more information onStream
objects, see Lyons and McLeod and Lyons et al..Stream
objects are parametrised sequential data viewed via Rough Path theory as a rough path.You can construct a
Stream
in many ways. You can use Lie increments:>>> roughpy.LieIncrementStream.from_increments(data, indices=times, ctx=context)
Tick streams:
# create tick stream data >>> data = { 1.0: [("first", "increment", 1.0),("second", "increment", 2.0)], 2.0: [("first", "increment", 1.0)] } # construct stream >>> tick_stream = TickStream.from_data(data, width=2, depth=2, dtype=DPReal)
Brownian streams:
# Generating on demand from a source of randomness with normal increments that approximate Brownian motion >>> brownian_stream = BrownianStream.with_generator(width=2, depth=2, dtype=DPReal)
Piecewise abelian streams:
# create piecewise lie data >>> piecewise_intervals = [RealInterval(float(i), float(i + 1)) for i in range(5)] >>> piecewise_lie_data = [ (interval, brownian_stream.log_signature(interval)) for interval in piecewise_intervals ] # construct stream >>> piecewise_abelian_stream = PiecewiseAbelianStream.construct(piecewise_lie_data, width=2, depth=2, dtype=DPReal)
Function streams:
# create a function to generate a stream from >>> def func(t, ctx): ... return Lie(np.array([t, 2*t]), ctx=ctx) #construct stream >>> function_stream = rp.FunctionStream.from_function(func, width=2, depth=2, dtype=rp.DPReal)
External source data:
# create a stream from an external source # here we use a sound file, but other formats are supported >>> roughpy.ExternalDataStream.from_uri("/path/to/sound_file.mp3", depth=2)
All of these
Stream
objects are constructed with different data types.As well as data, you will need to provide the following parameters:
ctx
Provide an algebra context in which to create the algebra, takes priority over the next 3.
Or
dtype
Scalar type for the algebra (deprecated, use
ctx
instead). Can be a RoughPy data type (rp.SPReal
,rp.DPReal
,rp.Rational
,rp.PolyRational
), or a Numpy dtype.
depth
Maximum degree for
Lie
objects,FreeTensor
objects, etc. (deprecated, usectx
instead)Stream
objects also have the following optional parameters:schema
An abstract description of what the comprises the channels of the underlying space in schema form. Can be deduced from data/constructor. If provided must be “correct” (i.e.
width
must be correct).channel_types
Sequence of channel types,
str
name of channel type (e.g.increment
), ordict
ofname: type
pairs. Used to construct a schema if you don’t have one of those already.include_time
Bool, indicates whether the parameter value should be included as a
stream
channel.vtype
Default vector type for algebras return from
Stream
methods. (dense
orsparse
). Default is currentlydense
, although this will change to be determined by the form of the underlyingStream
.resolution
Resolution for the dyadic dissection of the domain, and the default
resolution
used insignature()
/log_signature()
calculations.support
Interval
of parameter values on which theStream
has meaning.indices
For
LieIncrementStreams
, optionally provide a list/array of parameter values at which each row of the input data occurs. (default, row “i” occurs at parameter value “i”), or integer indicating the “column” of data that corresponds to the parameter. (Must be present in all rows)
- ctx
Provide an algebra context in which to create the algebra.
- dtype
Scalar type for the algebra (deprecated, use
ctx
instead). Can be a RoughPy data type (rp.SPReal
,rp.DPReal
,rp.Rational
,rp.PolyRational
), or a numpy dtype.
- resolution
resolution
for the dyadic dissection of the domain, and the default resolution used in signature/log_signature calculations.
- signature()
Compute the
signature()
of theStream
over anInterval
.
- signature_derivative()
Compute the derivative of a signature calculation with respect to a perturbation of the underlying path.
- class roughpy.StreamInterface
The stream interface is the means by which one converts an example of streaming data into a rough path.
- class roughpy.StreamSchema
- static from_data()
- get_labels()
- insert_categorical()
- insert_increment()
- insert_value()
- static parse()
- width()
- class roughpy.TensorBasis
- property depth
Truncation level
- property dimension
The number of elements represented by the vector.
- index_to_key(self: roughpy._roughpy.TensorBasis, index: int) roughpy._roughpy.TensorKey
Takes an integer and returns a
key
at that index.
- key_to_index(self: roughpy._roughpy.TensorBasis, key: roughpy._roughpy.LieKey) int
Takes a
key
and returns an integer corresponding to the index.
- parents(self: roughpy._roughpy.TensorBasis, key: roughpy._roughpy.TensorKey) tuple[int | None, int | None]
Splits off the first letter and returns the letter and the remainder of the word.
- size(self: roughpy._roughpy.TensorBasis, arg0: int) int
How big the dimension will be at a particular degree.
- property width
Alphabet size
- class roughpy.TensorKey
- basis(self: roughpy._roughpy.TensorKey) rpy::algebra::Basis<rpy::algebra::TensorBasisInterface>
- degree(self: roughpy._roughpy.TensorKey) int
- property max_degree
- reverse(self: roughpy._roughpy.TensorKey) roughpy._roughpy.TensorKey
- split_n(self: roughpy._roughpy.TensorKey, n: int) tuple[roughpy._roughpy.TensorKey, roughpy._roughpy.TensorKey]
- to_index(self: roughpy._roughpy.TensorKey) int
- to_letters(self: roughpy._roughpy.TensorKey) list[int]
- property width
- class roughpy.TensorKeyIterator
Iterator over tensor words.
- class roughpy.TickStreamConstructionHelper
Helps the stream figure out what its schema should be. A means of constructing the schema for a stream.
- add_categorical()
- add_increment()
- add_time_channel()
- add_value()
- class roughpy.VectorType
Members:
DenseVector
SparseVector
- DenseVector = <VectorType.DenseVector: 0>
- SparseVector = <VectorType.SparseVector: 1>
- property name
- property value
- roughpy.adjoint_to_free_multiply(multiplier: object, arg: object) object
Performs the adjoint of the free multiplication, \(A > A\).
- class roughpy.bfloat16
- roughpy.get_context(width: int, depth: int, coeffs: object = None, **kwargs) object
Takes
width
,depth
, andcoeff
as minimum, returns aContext
with that configuration, has other keywords that aren’t fully realised yet.
- roughpy.half_shuffle_multiply(left: object, right: object) object
Use a multiplication that isn’t the native one. For example, half shuffle two
ShuffleTensor
objects. Do what’s not allowed by type using*
(ish).
- roughpy.segment(interval: roughpy._roughpy.Interval, predicate: Callable[[roughpy._roughpy.Interval], bool], max_depth: int) list[roughpy._roughpy.RealInterval]
Perform dyadic segmentation on an
Interval
.
- roughpy.shuffle_multiply(left: object, right: object) object
Shuffle two
FreeTensor
objects. Use a multiplication that isn’t the native one.