Comparison Table#

Here is a list of NumPy APIs and its corresponding BrainPy implementations.

- in BrainPy column denotes that implementation is not provided yet. We welcome contributions for these functions.

Multi-dimensional Array#

NumPy

brainpy.math

jax.numpy

numpy.ndarray.all()

brainpy.math.ndarray.all()

jax.numpy.ndarray.all()

numpy.ndarray.any()

brainpy.math.ndarray.any()

jax.numpy.ndarray.any()

numpy.ndarray.argmax()

brainpy.math.ndarray.argmax()

jax.numpy.ndarray.argmax()

numpy.ndarray.argmin()

brainpy.math.ndarray.argmin()

jax.numpy.ndarray.argmin()

numpy.ndarray.argpartition()

brainpy.math.ndarray.argpartition()

jax.numpy.ndarray.argpartition()

numpy.ndarray.argsort()

brainpy.math.ndarray.argsort()

jax.numpy.ndarray.argsort()

numpy.ndarray.astype()

brainpy.math.ndarray.astype()

jax.numpy.ndarray.astype()

numpy.ndarray.byteswap()

brainpy.math.ndarray.byteswap()

-

numpy.ndarray.choose()

brainpy.math.ndarray.choose()

jax.numpy.ndarray.choose()

numpy.ndarray.clip()

brainpy.math.ndarray.clip()

jax.numpy.ndarray.clip()

numpy.ndarray.compress()

brainpy.math.ndarray.compress()

jax.numpy.ndarray.compress()

numpy.ndarray.conj()

brainpy.math.ndarray.conj()

jax.numpy.ndarray.conj()

numpy.ndarray.conjugate()

brainpy.math.ndarray.conjugate()

jax.numpy.ndarray.conjugate()

numpy.ndarray.copy()

brainpy.math.ndarray.copy()

jax.numpy.ndarray.copy()

numpy.ndarray.cumprod()

brainpy.math.ndarray.cumprod()

jax.numpy.ndarray.cumprod()

numpy.ndarray.cumsum()

brainpy.math.ndarray.cumsum()

jax.numpy.ndarray.cumsum()

numpy.ndarray.diagonal()

brainpy.math.ndarray.diagonal()

jax.numpy.ndarray.diagonal()

numpy.ndarray.dot()

brainpy.math.ndarray.dot()

jax.numpy.ndarray.dot()

numpy.ndarray.dump()

-

-

numpy.ndarray.dumps()

-

-

numpy.ndarray.fill()

brainpy.math.ndarray.fill()

-

numpy.ndarray.flatten()

brainpy.math.ndarray.flatten()

jax.numpy.ndarray.flatten()

numpy.ndarray.getfield()

-

-

numpy.ndarray.item()

brainpy.math.ndarray.item()

jax.numpy.ndarray.item()

numpy.ndarray.itemset()

-

-

numpy.ndarray.max()

brainpy.math.ndarray.max()

jax.numpy.ndarray.max()

numpy.ndarray.mean()

brainpy.math.ndarray.mean()

jax.numpy.ndarray.mean()

numpy.ndarray.min()

brainpy.math.ndarray.min()

jax.numpy.ndarray.min()

numpy.ndarray.newbyteorder()

-

-

numpy.ndarray.nonzero()

brainpy.math.ndarray.nonzero()

jax.numpy.ndarray.nonzero()

numpy.ndarray.partition()

-

-

numpy.ndarray.prod()

brainpy.math.ndarray.prod()

jax.numpy.ndarray.prod()

numpy.ndarray.ptp()

brainpy.math.ndarray.ptp()

jax.numpy.ndarray.ptp()

numpy.ndarray.put()

brainpy.math.ndarray.put()

-

numpy.ndarray.ravel()

brainpy.math.ndarray.ravel()

jax.numpy.ndarray.ravel()

numpy.ndarray.repeat()

brainpy.math.ndarray.repeat()

jax.numpy.ndarray.repeat()

numpy.ndarray.reshape()

brainpy.math.ndarray.reshape()

jax.numpy.ndarray.reshape()

numpy.ndarray.resize()

brainpy.math.ndarray.resize()

-

numpy.ndarray.round()

brainpy.math.ndarray.round()

jax.numpy.ndarray.round()

numpy.ndarray.searchsorted()

brainpy.math.ndarray.searchsorted()

jax.numpy.ndarray.searchsorted()

numpy.ndarray.setfield()

-

-

numpy.ndarray.setflags()

-

-

numpy.ndarray.sort()

brainpy.math.ndarray.sort()

jax.numpy.ndarray.sort()

numpy.ndarray.squeeze()

brainpy.math.ndarray.squeeze()

jax.numpy.ndarray.squeeze()

numpy.ndarray.std()

brainpy.math.ndarray.std()

jax.numpy.ndarray.std()

numpy.ndarray.sum()

brainpy.math.ndarray.sum()

jax.numpy.ndarray.sum()

numpy.ndarray.swapaxes()

brainpy.math.ndarray.swapaxes()

jax.numpy.ndarray.swapaxes()

numpy.ndarray.take()

brainpy.math.ndarray.take()

jax.numpy.ndarray.take()

numpy.ndarray.tobytes()

brainpy.math.ndarray.tobytes()

jax.numpy.ndarray.tobytes()

numpy.ndarray.tofile()

-

-

numpy.ndarray.tolist()

brainpy.math.ndarray.tolist()

jax.numpy.ndarray.tolist()

numpy.ndarray.tostring()

-

-

numpy.ndarray.trace()

brainpy.math.ndarray.trace()

jax.numpy.ndarray.trace()

numpy.ndarray.transpose()

brainpy.math.ndarray.transpose()

jax.numpy.ndarray.transpose()

numpy.ndarray.var()

brainpy.math.ndarray.var()

jax.numpy.ndarray.var()

numpy.ndarray.view()

brainpy.math.ndarray.view()

jax.numpy.ndarray.view()

-

brainpy.math.ndarray.block_host_until_ready()

-

-

brainpy.math.ndarray.block_until_ready()

-

-

brainpy.math.ndarray.numpy()

-

-

brainpy.math.ndarray.split()

-

-

brainpy.math.ndarray.tile()

-

-

brainpy.math.ndarray.to_jax()

-

-

brainpy.math.ndarray.to_numpy()

-

-

brainpy.math.ndarray.update()

-

Summary

  • Number of NumPy functions: 56

  • Number of functions covered by brainpy.math: 46

  • Number of functions unique in brainpy.math: 8

  • Number of functions covered by jax.numpy: 42

Array Operations#

NumPy

brainpy.math

jax.numpy

numpy.abs

brainpy.math.abs

jax.numpy.abs

numpy.absolute

brainpy.math.absolute

jax.numpy.absolute

numpy.add

brainpy.math.add

jax.numpy.add

numpy.add_docstring

brainpy.math.add_docstring

-

numpy.add_newdoc

brainpy.math.add_newdoc

-

numpy.add_newdoc_ufunc

brainpy.math.add_newdoc_ufunc

-

numpy.alen

-

-

numpy.all

brainpy.math.all

jax.numpy.all

numpy.allclose

brainpy.math.allclose

jax.numpy.allclose

numpy.alltrue

brainpy.math.alltrue

jax.numpy.alltrue

numpy.amax

brainpy.math.amax

jax.numpy.amax

numpy.amin

brainpy.math.amin

jax.numpy.amin

numpy.angle

brainpy.math.angle

jax.numpy.angle

numpy.any

brainpy.math.any

jax.numpy.any

numpy.append

brainpy.math.append

jax.numpy.append

numpy.apply_along_axis

brainpy.math.apply_along_axis

jax.numpy.apply_along_axis

numpy.apply_over_axes

brainpy.math.apply_over_axes

jax.numpy.apply_over_axes

numpy.arange

brainpy.math.arange

jax.numpy.arange

numpy.arccos

brainpy.math.arccos

jax.numpy.arccos

numpy.arccosh

brainpy.math.arccosh

jax.numpy.arccosh

numpy.arcsin

brainpy.math.arcsin

jax.numpy.arcsin

numpy.arcsinh

brainpy.math.arcsinh

jax.numpy.arcsinh

numpy.arctan

brainpy.math.arctan

jax.numpy.arctan

numpy.arctan2

brainpy.math.arctan2

jax.numpy.arctan2

numpy.arctanh

brainpy.math.arctanh

jax.numpy.arctanh

numpy.argmax

brainpy.math.argmax

jax.numpy.argmax

numpy.argmin

brainpy.math.argmin

jax.numpy.argmin

numpy.argpartition

-

-

numpy.argsort

brainpy.math.argsort

jax.numpy.argsort

numpy.argwhere

brainpy.math.argwhere

jax.numpy.argwhere

numpy.around

brainpy.math.around

jax.numpy.around

numpy.array

brainpy.math.array

jax.numpy.array

numpy.array2string

brainpy.math.array2string

-

numpy.array_equal

brainpy.math.array_equal

jax.numpy.array_equal

numpy.array_equiv

brainpy.math.array_equiv

jax.numpy.array_equiv

numpy.array_repr

brainpy.math.array_repr

jax.numpy.array_repr

numpy.array_split

brainpy.math.array_split

jax.numpy.array_split

numpy.array_str

brainpy.math.array_str

jax.numpy.array_str

numpy.asanyarray

brainpy.math.asanyarray

-

numpy.asarray

brainpy.math.asarray

jax.numpy.asarray

numpy.asarray_chkfinite

-

-

numpy.ascontiguousarray

brainpy.math.ascontiguousarray

-

numpy.asfarray

brainpy.math.asfarray

-

numpy.asfortranarray

-

-

numpy.asmatrix

-

-

numpy.asscalar

brainpy.math.asscalar

-

numpy.atleast_1d

brainpy.math.atleast_1d

jax.numpy.atleast_1d

numpy.atleast_2d

brainpy.math.atleast_2d

jax.numpy.atleast_2d

numpy.atleast_3d

brainpy.math.atleast_3d

jax.numpy.atleast_3d

numpy.average

brainpy.math.average

jax.numpy.average

numpy.bartlett

brainpy.math.bartlett

jax.numpy.bartlett

numpy.base_repr

-

-

numpy.binary_repr

-

-

numpy.bincount

brainpy.math.bincount

jax.numpy.bincount

numpy.bitwise_and

brainpy.math.bitwise_and

jax.numpy.bitwise_and

numpy.bitwise_not

brainpy.math.bitwise_not

jax.numpy.bitwise_not

numpy.bitwise_or

brainpy.math.bitwise_or

jax.numpy.bitwise_or

numpy.bitwise_xor

brainpy.math.bitwise_xor

jax.numpy.bitwise_xor

numpy.blackman

brainpy.math.blackman

jax.numpy.blackman

numpy.block

brainpy.math.block

jax.numpy.block

numpy.bmat

-

-

numpy.broadcast_arrays

brainpy.math.broadcast_arrays

jax.numpy.broadcast_arrays

numpy.broadcast_shapes

brainpy.math.broadcast_shapes

jax.numpy.broadcast_shapes

numpy.broadcast_to

brainpy.math.broadcast_to

jax.numpy.broadcast_to

numpy.busday_count

-

-

numpy.busday_offset

-

-

numpy.byte_bounds

-

-

numpy.can_cast

brainpy.math.can_cast

jax.numpy.can_cast

numpy.cbrt

brainpy.math.cbrt

jax.numpy.cbrt

numpy.ceil

brainpy.math.ceil

jax.numpy.ceil

numpy.choose

brainpy.math.choose

jax.numpy.choose

numpy.clip

brainpy.math.clip

jax.numpy.clip

numpy.column_stack

brainpy.math.column_stack

jax.numpy.column_stack

numpy.common_type

brainpy.math.common_type

-

numpy.compare_chararrays

-

-

numpy.compress

brainpy.math.compress

jax.numpy.compress

numpy.concatenate

brainpy.math.concatenate

jax.numpy.concatenate

numpy.conj

brainpy.math.conj

jax.numpy.conj

numpy.conjugate

brainpy.math.conjugate

jax.numpy.conjugate

numpy.convolve

brainpy.math.convolve

jax.numpy.convolve

numpy.copy

brainpy.math.copy

jax.numpy.copy

numpy.copysign

brainpy.math.copysign

jax.numpy.copysign

numpy.copyto

-

-

numpy.corrcoef

brainpy.math.corrcoef

jax.numpy.corrcoef

numpy.correlate

brainpy.math.correlate

jax.numpy.correlate

numpy.cos

brainpy.math.cos

jax.numpy.cos

numpy.cosh

brainpy.math.cosh

jax.numpy.cosh

numpy.count_nonzero

brainpy.math.count_nonzero

jax.numpy.count_nonzero

numpy.cov

brainpy.math.cov

jax.numpy.cov

numpy.cross

brainpy.math.cross

jax.numpy.cross

numpy.cumprod

brainpy.math.cumprod

jax.numpy.cumprod

numpy.cumproduct

brainpy.math.cumproduct

jax.numpy.cumproduct

numpy.cumsum

brainpy.math.cumsum

jax.numpy.cumsum

numpy.datetime_as_string

-

-

numpy.datetime_data

-

-

numpy.deg2rad

brainpy.math.deg2rad

jax.numpy.deg2rad

numpy.degrees

brainpy.math.degrees

jax.numpy.degrees

numpy.delete

brainpy.math.delete

jax.numpy.delete

numpy.deprecate

-

-

numpy.deprecate_with_doc

-

-

numpy.diag

brainpy.math.diag

jax.numpy.diag

numpy.diag_indices

brainpy.math.diag_indices

jax.numpy.diag_indices

numpy.diag_indices_from

brainpy.math.diag_indices_from

jax.numpy.diag_indices_from

numpy.diagflat

brainpy.math.diagflat

jax.numpy.diagflat

numpy.diagonal

brainpy.math.diagonal

jax.numpy.diagonal

numpy.diff

brainpy.math.diff

jax.numpy.diff

numpy.digitize

brainpy.math.digitize

jax.numpy.digitize

numpy.disp

brainpy.math.disp

-

numpy.divide

brainpy.math.divide

jax.numpy.divide

numpy.divmod

brainpy.math.divmod

jax.numpy.divmod

numpy.dot

brainpy.math.dot

jax.numpy.dot

numpy.dsplit

brainpy.math.dsplit

jax.numpy.dsplit

numpy.dstack

brainpy.math.dstack

jax.numpy.dstack

numpy.ediff1d

brainpy.math.ediff1d

jax.numpy.ediff1d

numpy.einsum

brainpy.math.einsum

jax.numpy.einsum

numpy.einsum_path

brainpy.math.einsum_path

jax.numpy.einsum_path

numpy.empty

brainpy.math.empty

jax.numpy.empty

numpy.empty_like

brainpy.math.empty_like

jax.numpy.empty_like

numpy.equal

brainpy.math.equal

jax.numpy.equal

numpy.exp

brainpy.math.exp

jax.numpy.exp

numpy.exp2

brainpy.math.exp2

jax.numpy.exp2

numpy.expand_dims

brainpy.math.expand_dims

jax.numpy.expand_dims

numpy.expm1

brainpy.math.expm1

jax.numpy.expm1

numpy.extract

brainpy.math.extract

jax.numpy.extract

numpy.eye

brainpy.math.eye

jax.numpy.eye

numpy.fabs

brainpy.math.fabs

jax.numpy.fabs

numpy.fastCopyAndTranspose

-

-

numpy.fill_diagonal

brainpy.math.fill_diagonal

-

numpy.find_common_type

-

-

numpy.fix

brainpy.math.fix

jax.numpy.fix

numpy.flatnonzero

brainpy.math.flatnonzero

jax.numpy.flatnonzero

numpy.flip

brainpy.math.flip

jax.numpy.flip

numpy.fliplr

brainpy.math.fliplr

jax.numpy.fliplr

numpy.flipud

brainpy.math.flipud

jax.numpy.flipud

numpy.float_power

brainpy.math.float_power

jax.numpy.float_power

numpy.floor

brainpy.math.floor

jax.numpy.floor

numpy.floor_divide

brainpy.math.floor_divide

jax.numpy.floor_divide

numpy.fmax

brainpy.math.fmax

jax.numpy.fmax

numpy.fmin

brainpy.math.fmin

jax.numpy.fmin

numpy.fmod

brainpy.math.fmod

jax.numpy.fmod

numpy.format_float_positional

-

-

numpy.format_float_scientific

-

-

numpy.frexp

brainpy.math.frexp

jax.numpy.frexp

numpy.frombuffer

brainpy.math.frombuffer

jax.numpy.frombuffer

numpy.fromfile

brainpy.math.fromfile

jax.numpy.fromfile

numpy.fromfunction

brainpy.math.fromfunction

jax.numpy.fromfunction

numpy.fromiter

brainpy.math.fromiter

jax.numpy.fromiter

numpy.frompyfunc

-

-

numpy.fromregex

-

-

numpy.fromstring

brainpy.math.fromstring

jax.numpy.fromstring

numpy.full

brainpy.math.full

jax.numpy.full

numpy.full_like

brainpy.math.full_like

jax.numpy.full_like

numpy.gcd

brainpy.math.gcd

jax.numpy.gcd

numpy.genfromtxt

brainpy.math.genfromtxt

-

numpy.geomspace

brainpy.math.geomspace

jax.numpy.geomspace

numpy.get_array_wrap

-

-

numpy.get_include

-

-

numpy.get_printoptions

brainpy.math.get_printoptions

jax.numpy.get_printoptions

numpy.getbufsize

-

-

numpy.geterr

-

-

numpy.geterrcall

-

-

numpy.geterrobj

-

-

numpy.gradient

brainpy.math.gradient

jax.numpy.gradient

numpy.greater

brainpy.math.greater

jax.numpy.greater

numpy.greater_equal

brainpy.math.greater_equal

jax.numpy.greater_equal

numpy.hamming

brainpy.math.hamming

jax.numpy.hamming

numpy.hanning

brainpy.math.hanning

jax.numpy.hanning

numpy.heaviside

brainpy.math.heaviside

jax.numpy.heaviside

numpy.histogram

brainpy.math.histogram

jax.numpy.histogram

numpy.histogram2d

brainpy.math.histogram2d

jax.numpy.histogram2d

numpy.histogram_bin_edges

brainpy.math.histogram_bin_edges

jax.numpy.histogram_bin_edges

numpy.histogramdd

brainpy.math.histogramdd

jax.numpy.histogramdd

numpy.hsplit

brainpy.math.hsplit

jax.numpy.hsplit

numpy.hstack

brainpy.math.hstack

jax.numpy.hstack

numpy.hypot

brainpy.math.hypot

jax.numpy.hypot

numpy.i0

brainpy.math.i0

jax.numpy.i0

numpy.imag

brainpy.math.imag

jax.numpy.imag

numpy.in1d

brainpy.math.in1d

jax.numpy.in1d

numpy.indices

brainpy.math.indices

jax.numpy.indices

numpy.info

brainpy.math.info

-

numpy.inner

brainpy.math.inner

jax.numpy.inner

numpy.insert

brainpy.math.insert

jax.numpy.insert

numpy.interp

brainpy.math.interp

jax.numpy.interp

numpy.intersect1d

brainpy.math.intersect1d

jax.numpy.intersect1d

numpy.invert

brainpy.math.invert

jax.numpy.invert

numpy.is_busday

-

-

numpy.isclose

brainpy.math.isclose

jax.numpy.isclose

numpy.iscomplex

brainpy.math.iscomplex

jax.numpy.iscomplex

numpy.iscomplexobj

brainpy.math.iscomplexobj

jax.numpy.iscomplexobj

numpy.isfinite

brainpy.math.isfinite

jax.numpy.isfinite

numpy.isfortran

-

-

numpy.isin

brainpy.math.isin

jax.numpy.isin

numpy.isinf

brainpy.math.isinf

jax.numpy.isinf

numpy.isnan

brainpy.math.isnan

jax.numpy.isnan

numpy.isnat

-

-

numpy.isneginf

brainpy.math.isneginf

jax.numpy.isneginf

numpy.isposinf

brainpy.math.isposinf

jax.numpy.isposinf

numpy.isreal

brainpy.math.isreal

jax.numpy.isreal

numpy.isrealobj

brainpy.math.isrealobj

jax.numpy.isrealobj

numpy.isscalar

brainpy.math.isscalar

jax.numpy.isscalar

numpy.issctype

-

-

numpy.issubclass_

brainpy.math.issubclass_

-

numpy.issubdtype

brainpy.math.issubdtype

jax.numpy.issubdtype

numpy.issubsctype

brainpy.math.issubsctype

jax.numpy.issubsctype

numpy.iterable

brainpy.math.iterable

jax.numpy.iterable

numpy.ix_

brainpy.math.ix_

jax.numpy.ix_

numpy.kaiser

brainpy.math.kaiser

jax.numpy.kaiser

numpy.kron

brainpy.math.kron

jax.numpy.kron

numpy.lcm

brainpy.math.lcm

jax.numpy.lcm

numpy.ldexp

brainpy.math.ldexp

jax.numpy.ldexp

numpy.left_shift

brainpy.math.left_shift

jax.numpy.left_shift

numpy.less

brainpy.math.less

jax.numpy.less

numpy.less_equal

brainpy.math.less_equal

jax.numpy.less_equal

numpy.lexsort

brainpy.math.lexsort

jax.numpy.lexsort

numpy.linspace

brainpy.math.linspace

jax.numpy.linspace

numpy.load

brainpy.math.load

jax.numpy.load

numpy.loads

-

-

numpy.loadtxt

brainpy.math.loadtxt

-

numpy.log

brainpy.math.log

jax.numpy.log

numpy.log10

brainpy.math.log10

jax.numpy.log10

numpy.log1p

brainpy.math.log1p

jax.numpy.log1p

numpy.log2

brainpy.math.log2

jax.numpy.log2

numpy.logaddexp

brainpy.math.logaddexp

jax.numpy.logaddexp

numpy.logaddexp2

brainpy.math.logaddexp2

jax.numpy.logaddexp2

numpy.logical_and

brainpy.math.logical_and

jax.numpy.logical_and

numpy.logical_not

brainpy.math.logical_not

jax.numpy.logical_not

numpy.logical_or

brainpy.math.logical_or

jax.numpy.logical_or

numpy.logical_xor

brainpy.math.logical_xor

jax.numpy.logical_xor

numpy.logspace

brainpy.math.logspace

jax.numpy.logspace

numpy.lookfor

-

-

numpy.mafromtxt

-

-

numpy.mask_indices

brainpy.math.mask_indices

jax.numpy.mask_indices

numpy.mat

-

-

numpy.matmul

brainpy.math.matmul

jax.numpy.matmul

numpy.max

brainpy.math.max

jax.numpy.max

numpy.maximum

brainpy.math.maximum

jax.numpy.maximum

numpy.maximum_sctype

-

-

numpy.may_share_memory

-

-

numpy.mean

brainpy.math.mean

jax.numpy.mean

numpy.median

brainpy.math.median

jax.numpy.median

numpy.meshgrid

brainpy.math.meshgrid

jax.numpy.meshgrid

numpy.min

brainpy.math.min

jax.numpy.min

numpy.min_scalar_type

-

-

numpy.minimum

brainpy.math.minimum

jax.numpy.minimum

numpy.mintypecode

-

-

numpy.mod

brainpy.math.mod

jax.numpy.mod

numpy.modf

brainpy.math.modf

jax.numpy.modf

numpy.moveaxis

brainpy.math.moveaxis

jax.numpy.moveaxis

numpy.msort

brainpy.math.msort

jax.numpy.msort

numpy.multiply

brainpy.math.multiply

jax.numpy.multiply

numpy.nan_to_num

brainpy.math.nan_to_num

jax.numpy.nan_to_num

numpy.nanargmax

brainpy.math.nanargmax

jax.numpy.nanargmax

numpy.nanargmin

brainpy.math.nanargmin

jax.numpy.nanargmin

numpy.nancumprod

brainpy.math.nancumprod

jax.numpy.nancumprod

numpy.nancumsum

brainpy.math.nancumsum

jax.numpy.nancumsum

numpy.nanmax

brainpy.math.nanmax

jax.numpy.nanmax

numpy.nanmean

brainpy.math.nanmean

jax.numpy.nanmean

numpy.nanmedian

brainpy.math.nanmedian

jax.numpy.nanmedian

numpy.nanmin

brainpy.math.nanmin

jax.numpy.nanmin

numpy.nanpercentile

brainpy.math.nanpercentile

jax.numpy.nanpercentile

numpy.nanprod

brainpy.math.nanprod

jax.numpy.nanprod

numpy.nanquantile

brainpy.math.nanquantile

jax.numpy.nanquantile

numpy.nanstd

brainpy.math.nanstd

jax.numpy.nanstd

numpy.nansum

brainpy.math.nansum

jax.numpy.nansum

numpy.nanvar

brainpy.math.nanvar

jax.numpy.nanvar

numpy.ndfromtxt

-

-

numpy.ndim

brainpy.math.ndim

jax.numpy.ndim

numpy.negative

brainpy.math.negative

jax.numpy.negative

numpy.nested_iters

-

-

numpy.nextafter

brainpy.math.nextafter

jax.numpy.nextafter

numpy.nonzero

brainpy.math.nonzero

jax.numpy.nonzero

numpy.not_equal

brainpy.math.not_equal

jax.numpy.not_equal

numpy.obj2sctype

-

-

numpy.ones

brainpy.math.ones

jax.numpy.ones

numpy.ones_like

brainpy.math.ones_like

jax.numpy.ones_like

numpy.outer

brainpy.math.outer

jax.numpy.outer

numpy.packbits

brainpy.math.packbits

jax.numpy.packbits

numpy.pad

brainpy.math.pad

jax.numpy.pad

numpy.partition

-

-

numpy.percentile

brainpy.math.percentile

jax.numpy.percentile

numpy.piecewise

brainpy.math.piecewise

jax.numpy.piecewise

numpy.place

brainpy.math.place

-

numpy.poly

brainpy.math.poly

jax.numpy.poly

numpy.polyadd

brainpy.math.polyadd

jax.numpy.polyadd

numpy.polyder

brainpy.math.polyder

jax.numpy.polyder

numpy.polydiv

brainpy.math.polydiv

-

numpy.polyfit

brainpy.math.polyfit

jax.numpy.polyfit

numpy.polyint

brainpy.math.polyint

jax.numpy.polyint

numpy.polymul

brainpy.math.polymul

jax.numpy.polymul

numpy.polysub

brainpy.math.polysub

jax.numpy.polysub

numpy.polyval

brainpy.math.polyval

jax.numpy.polyval

numpy.positive

brainpy.math.positive

jax.numpy.positive

numpy.power

brainpy.math.power

jax.numpy.power

numpy.printoptions

brainpy.math.printoptions

jax.numpy.printoptions

numpy.prod

brainpy.math.prod

jax.numpy.prod

numpy.product

brainpy.math.product

jax.numpy.product

numpy.promote_types

brainpy.math.promote_types

jax.numpy.promote_types

numpy.ptp

brainpy.math.ptp

jax.numpy.ptp

numpy.put

brainpy.math.put

-

numpy.put_along_axis

-

-

numpy.putmask

brainpy.math.putmask

-

numpy.quantile

brainpy.math.quantile

jax.numpy.quantile

numpy.rad2deg

brainpy.math.rad2deg

jax.numpy.rad2deg

numpy.radians

brainpy.math.radians

jax.numpy.radians

numpy.ravel

brainpy.math.ravel

jax.numpy.ravel

numpy.ravel_multi_index

brainpy.math.ravel_multi_index

jax.numpy.ravel_multi_index

numpy.real

brainpy.math.real

jax.numpy.real

numpy.real_if_close

-

-

numpy.recfromcsv

-

-

numpy.recfromtxt

-

-

numpy.reciprocal

brainpy.math.reciprocal

jax.numpy.reciprocal

numpy.remainder

brainpy.math.remainder

jax.numpy.remainder

numpy.repeat

brainpy.math.repeat

jax.numpy.repeat

numpy.require

-

-

numpy.reshape

brainpy.math.reshape

jax.numpy.reshape

numpy.resize

brainpy.math.resize

jax.numpy.resize

numpy.result_type

brainpy.math.result_type

jax.numpy.result_type

numpy.right_shift

brainpy.math.right_shift

jax.numpy.right_shift

numpy.rint

brainpy.math.rint

jax.numpy.rint

numpy.roll

brainpy.math.roll

jax.numpy.roll

numpy.rollaxis

brainpy.math.rollaxis

jax.numpy.rollaxis

numpy.roots

brainpy.math.roots

jax.numpy.roots

numpy.rot90

brainpy.math.rot90

jax.numpy.rot90

numpy.round

brainpy.math.round

jax.numpy.round

numpy.round_

brainpy.math.round_

jax.numpy.round_

numpy.row_stack

brainpy.math.row_stack

jax.numpy.row_stack

numpy.safe_eval

brainpy.math.safe_eval

-

numpy.save

brainpy.math.save

jax.numpy.save

numpy.savetxt

brainpy.math.savetxt

-

numpy.savez

brainpy.math.savez

jax.numpy.savez

numpy.savez_compressed

brainpy.math.savez_compressed

-

numpy.sctype2char

-

-

numpy.searchsorted

brainpy.math.searchsorted

jax.numpy.searchsorted

numpy.select

brainpy.math.select

jax.numpy.select

numpy.set_numeric_ops

-

-

numpy.set_printoptions

brainpy.math.set_printoptions

jax.numpy.set_printoptions

numpy.set_string_function

-

-

numpy.setbufsize

-

-

numpy.setdiff1d

brainpy.math.setdiff1d

jax.numpy.setdiff1d

numpy.seterr

-

-

numpy.seterrcall

-

-

numpy.seterrobj

-

-

numpy.setxor1d

brainpy.math.setxor1d

jax.numpy.setxor1d

numpy.shape

brainpy.math.shape

jax.numpy.shape

numpy.shares_memory

-

-

numpy.show_config

brainpy.math.show_config

-

numpy.sign

brainpy.math.sign

jax.numpy.sign

numpy.signbit

brainpy.math.signbit

jax.numpy.signbit

numpy.sin

brainpy.math.sin

jax.numpy.sin

numpy.sinc

brainpy.math.sinc

jax.numpy.sinc

numpy.sinh

brainpy.math.sinh

jax.numpy.sinh

numpy.size

brainpy.math.size

jax.numpy.size

numpy.sometrue

brainpy.math.sometrue

jax.numpy.sometrue

numpy.sort

brainpy.math.sort

jax.numpy.sort

numpy.sort_complex

brainpy.math.sort_complex

jax.numpy.sort_complex

numpy.source

-

-

numpy.spacing

-

-

numpy.split

brainpy.math.split

jax.numpy.split

numpy.sqrt

brainpy.math.sqrt

jax.numpy.sqrt

numpy.square

brainpy.math.square

jax.numpy.square

numpy.squeeze

brainpy.math.squeeze

jax.numpy.squeeze

numpy.stack

brainpy.math.stack

jax.numpy.stack

numpy.std

brainpy.math.std

jax.numpy.std

numpy.subtract

brainpy.math.subtract

jax.numpy.subtract

numpy.sum

brainpy.math.sum

jax.numpy.sum

numpy.swapaxes

brainpy.math.swapaxes

jax.numpy.swapaxes

numpy.take

brainpy.math.take

jax.numpy.take

numpy.take_along_axis

brainpy.math.take_along_axis

jax.numpy.take_along_axis

numpy.tan

brainpy.math.tan

jax.numpy.tan

numpy.tensordot

brainpy.math.tensordot

jax.numpy.tensordot

numpy.tile

brainpy.math.tile

jax.numpy.tile

numpy.trace

brainpy.math.trace

jax.numpy.trace

numpy.transpose

brainpy.math.transpose

jax.numpy.transpose

numpy.trapz

brainpy.math.trapz

jax.numpy.trapz

numpy.tri

brainpy.math.tri

jax.numpy.tri

numpy.tril

brainpy.math.tril

jax.numpy.tril

numpy.tril_indices

brainpy.math.tril_indices

jax.numpy.tril_indices

numpy.tril_indices_from

brainpy.math.tril_indices_from

jax.numpy.tril_indices_from

numpy.trim_zeros

brainpy.math.trim_zeros

jax.numpy.trim_zeros

numpy.triu

brainpy.math.triu

jax.numpy.triu

numpy.triu_indices

brainpy.math.triu_indices

jax.numpy.triu_indices

numpy.triu_indices_from

brainpy.math.triu_indices_from

jax.numpy.triu_indices_from

numpy.true_divide

brainpy.math.true_divide

jax.numpy.true_divide

numpy.trunc

brainpy.math.trunc

jax.numpy.trunc

numpy.typename

brainpy.math.typename

-

numpy.union1d

brainpy.math.union1d

jax.numpy.union1d

numpy.unique

brainpy.math.unique

jax.numpy.unique

numpy.unpackbits

brainpy.math.unpackbits

jax.numpy.unpackbits

numpy.unravel_index

brainpy.math.unravel_index

jax.numpy.unravel_index

numpy.unwrap

brainpy.math.unwrap

jax.numpy.unwrap

numpy.vander

brainpy.math.vander

jax.numpy.vander

numpy.var

brainpy.math.var

jax.numpy.var

numpy.vdot

brainpy.math.vdot

jax.numpy.vdot

numpy.vsplit

brainpy.math.vsplit

jax.numpy.vsplit

numpy.vstack

brainpy.math.vstack

jax.numpy.vstack

numpy.where

brainpy.math.where

jax.numpy.where

numpy.who

-

-

numpy.zeros

brainpy.math.zeros

jax.numpy.zeros

numpy.zeros_like

brainpy.math.zeros_like

jax.numpy.zeros_like

-

brainpy.math.as_numpy

-

-

brainpy.math.as_variable

-

-

brainpy.math.clip_by_norm

-

-

brainpy.math.get_dcomplex

-

-

brainpy.math.get_dfloat

-

-

brainpy.math.get_dint

-

-

brainpy.math.pre2post_event_prod

-

-

brainpy.math.pre2post_event_sum

-

-

brainpy.math.pre2post_max

-

-

brainpy.math.pre2post_mean

-

-

brainpy.math.pre2post_min

-

-

brainpy.math.pre2post_prod

-

-

brainpy.math.pre2post_sum

-

-

brainpy.math.pre2syn

-

-

brainpy.math.register_op

-

-

brainpy.math.remove_diag

-

-

brainpy.math.segment_max

-

-

brainpy.math.segment_min

-

-

brainpy.math.segment_prod

-

-

brainpy.math.segment_sum

-

-

brainpy.math.set_dcomplex

-

-

brainpy.math.set_dfloat

-

-

brainpy.math.set_dint

-

-

brainpy.math.sparse_matmul

-

-

brainpy.math.syn2post

-

-

brainpy.math.syn2post_max

-

-

brainpy.math.syn2post_mean

-

-

brainpy.math.syn2post_min

-

-

brainpy.math.syn2post_prod

-

-

brainpy.math.syn2post_softmax

-

-

brainpy.math.syn2post_sum

-

Summary

  • Number of NumPy functions: 399

  • Number of functions covered by brainpy.math: 338

  • Number of functions unique in brainpy.math: 31

  • Number of functions covered by jax.numpy: 314

Linear Algebra#

NumPy

brainpy.math

jax.numpy

numpy.linalg.cholesky

brainpy.math.linalg.cholesky

jax.numpy.linalg.cholesky

numpy.linalg.det

brainpy.math.linalg.det

jax.numpy.linalg.det

numpy.linalg.eig

brainpy.math.linalg.eig

jax.numpy.linalg.eig

numpy.linalg.eigh

brainpy.math.linalg.eigh

jax.numpy.linalg.eigh

numpy.linalg.eigvals

brainpy.math.linalg.eigvals

jax.numpy.linalg.eigvals

numpy.linalg.eigvalsh

brainpy.math.linalg.eigvalsh

jax.numpy.linalg.eigvalsh

numpy.linalg.inv

brainpy.math.linalg.inv

jax.numpy.linalg.inv

numpy.linalg.lstsq

brainpy.math.linalg.lstsq

jax.numpy.linalg.lstsq

numpy.linalg.matrix_power

brainpy.math.linalg.matrix_power

jax.numpy.linalg.matrix_power

numpy.linalg.matrix_rank

brainpy.math.linalg.matrix_rank

jax.numpy.linalg.matrix_rank

numpy.linalg.multi_dot

brainpy.math.linalg.multi_dot

jax.numpy.linalg.multi_dot

numpy.linalg.norm

brainpy.math.linalg.norm

jax.numpy.linalg.norm

numpy.linalg.pinv

brainpy.math.linalg.pinv

jax.numpy.linalg.pinv

numpy.linalg.qr

brainpy.math.linalg.qr

jax.numpy.linalg.qr

numpy.linalg.slogdet

brainpy.math.linalg.slogdet

jax.numpy.linalg.slogdet

numpy.linalg.solve

brainpy.math.linalg.solve

jax.numpy.linalg.solve

numpy.linalg.svd

brainpy.math.linalg.svd

jax.numpy.linalg.svd

numpy.linalg.tensorinv

brainpy.math.linalg.tensorinv

jax.numpy.linalg.tensorinv

numpy.linalg.tensorsolve

brainpy.math.linalg.tensorsolve

jax.numpy.linalg.tensorsolve

Summary

  • Number of NumPy functions: 19

  • Number of functions covered by brainpy.math: 19

  • Number of functions unique in brainpy.math: 0

  • Number of functions covered by jax.numpy: 19

Discrete Fourier Transform#

NumPy

brainpy.math

jax.numpy

numpy.fft.fft

brainpy.math.fft.fft

jax.numpy.fft.fft

numpy.fft.fft2

brainpy.math.fft.fft2

jax.numpy.fft.fft2

numpy.fft.fftfreq

brainpy.math.fft.fftfreq

jax.numpy.fft.fftfreq

numpy.fft.fftn

brainpy.math.fft.fftn

jax.numpy.fft.fftn

numpy.fft.fftshift

brainpy.math.fft.fftshift

jax.numpy.fft.fftshift

numpy.fft.hfft

brainpy.math.fft.hfft

jax.numpy.fft.hfft

numpy.fft.ifft

brainpy.math.fft.ifft

jax.numpy.fft.ifft

numpy.fft.ifft2

brainpy.math.fft.ifft2

jax.numpy.fft.ifft2

numpy.fft.ifftn

brainpy.math.fft.ifftn

jax.numpy.fft.ifftn

numpy.fft.ifftshift

brainpy.math.fft.ifftshift

jax.numpy.fft.ifftshift

numpy.fft.ihfft

brainpy.math.fft.ihfft

jax.numpy.fft.ihfft

numpy.fft.irfft

brainpy.math.fft.irfft

jax.numpy.fft.irfft

numpy.fft.irfft2

brainpy.math.fft.irfft2

jax.numpy.fft.irfft2

numpy.fft.irfftn

brainpy.math.fft.irfftn

jax.numpy.fft.irfftn

numpy.fft.rfft

brainpy.math.fft.rfft

jax.numpy.fft.rfft

numpy.fft.rfft2

brainpy.math.fft.rfft2

jax.numpy.fft.rfft2

numpy.fft.rfftfreq

brainpy.math.fft.rfftfreq

jax.numpy.fft.rfftfreq

numpy.fft.rfftn

brainpy.math.fft.rfftn

jax.numpy.fft.rfftn

Summary

  • Number of NumPy functions: 18

  • Number of functions covered by brainpy.math: 18

  • Number of functions unique in brainpy.math: 0

  • Number of functions covered by jax.numpy: 18

Random Sampling#

NumPy

brainpy.math

jax.numpy

numpy.random.beta

brainpy.math.random.beta

jax.random.beta

numpy.random.binomial

brainpy.math.random.binomial

-

numpy.random.bytes

-

-

numpy.random.chisquare

brainpy.math.random.chisquare

-

numpy.random.choice

brainpy.math.random.choice

jax.random.choice

numpy.random.default_rng

brainpy.math.random.default_rng

-

numpy.random.dirichlet

brainpy.math.random.dirichlet

jax.random.dirichlet

numpy.random.exponential

brainpy.math.random.exponential

jax.random.exponential

numpy.random.f

brainpy.math.random.f

-

numpy.random.gamma

brainpy.math.random.gamma

jax.random.gamma

numpy.random.geometric

brainpy.math.random.geometric

-

numpy.random.get_state

-

-

numpy.random.gumbel

brainpy.math.random.gumbel

jax.random.gumbel

numpy.random.hypergeometric

brainpy.math.random.hypergeometric

-

numpy.random.laplace

brainpy.math.random.laplace

jax.random.laplace

numpy.random.logistic

brainpy.math.random.logistic

jax.random.logistic

numpy.random.lognormal

brainpy.math.random.lognormal

-

numpy.random.logseries

brainpy.math.random.logseries

-

numpy.random.multinomial

brainpy.math.random.multinomial

-

numpy.random.multivariate_normal

brainpy.math.random.multivariate_normal

jax.random.multivariate_normal

numpy.random.negative_binomial

brainpy.math.random.negative_binomial

-

numpy.random.noncentral_chisquare

brainpy.math.random.noncentral_chisquare

-

numpy.random.noncentral_f

brainpy.math.random.noncentral_f

-

numpy.random.normal

brainpy.math.random.normal

jax.random.normal

numpy.random.pareto

brainpy.math.random.pareto

jax.random.pareto

numpy.random.permutation

brainpy.math.random.permutation

jax.random.permutation

numpy.random.poisson

brainpy.math.random.poisson

jax.random.poisson

numpy.random.power

brainpy.math.random.power

-

numpy.random.rand

brainpy.math.random.rand

-

numpy.random.randint

brainpy.math.random.randint

jax.random.randint

numpy.random.randn

brainpy.math.random.randn

-

numpy.random.random

brainpy.math.random.random

-

numpy.random.random_integers

brainpy.math.random.random_integers

-

numpy.random.random_sample

brainpy.math.random.random_sample

-

numpy.random.ranf

brainpy.math.random.ranf

-

numpy.random.rayleigh

brainpy.math.random.rayleigh

-

numpy.random.sample

brainpy.math.random.sample

-

numpy.random.seed

brainpy.math.random.seed

-

numpy.random.set_state

-

-

numpy.random.shuffle

brainpy.math.random.shuffle

jax.random.shuffle

numpy.random.standard_cauchy

brainpy.math.random.standard_cauchy

-

numpy.random.standard_exponential

brainpy.math.random.standard_exponential

-

numpy.random.standard_gamma

brainpy.math.random.standard_gamma

-

numpy.random.standard_normal

brainpy.math.random.standard_normal

-

numpy.random.standard_t

brainpy.math.random.standard_t

-

numpy.random.triangular

brainpy.math.random.triangular

-

numpy.random.uniform

brainpy.math.random.uniform

jax.random.uniform

numpy.random.vonmises

brainpy.math.random.vonmises

-

numpy.random.wald

brainpy.math.random.wald

-

numpy.random.weibull

brainpy.math.random.weibull

-

numpy.random.zipf

brainpy.math.random.zipf

-

-

brainpy.math.random.bernoulli

jax.random.bernoulli

-

brainpy.math.random.categorical

jax.random.categorical

-

brainpy.math.random.loggamma

jax.random.loggamma

-

brainpy.math.random.maxwell

jax.random.maxwell

-

brainpy.math.random.orthogonal

jax.random.orthogonal

-

brainpy.math.random.t

jax.random.t

-

brainpy.math.random.truncated_normal

jax.random.truncated_normal

-

brainpy.math.random.weibull_min

jax.random.weibull_min

Summary

  • Number of NumPy functions: 51

  • Number of functions covered by brainpy.math: 48

  • Number of functions unique in brainpy.math: 8

  • Number of functions covered by jax.numpy: 16