utilities#

Module path: cuqi.utilities

Functions

approx_derivative

Approximates the derivative of callable (possibly vector-valued) function func evaluated at point wrt.

approx_gradient

Approximates the gradient of callable scalar function func evaluated at point x.

check_if_conditional_from_attr

Check if a distribution is conditional from a given attribute.

force_ndarray

get_direct_attributes

get_indirect_variables

get_non_default_args

Returns the non-default arguments and kwargs from a callable function

get_writeable_attributes

Get writeable attributes of object instance.

get_writeable_properties

Get writeable properties of class type.

infer_len

Infer the length of the given input value.

plot_1D_density

Plot 1D density function

plot_2D_density

Plot 2D density function

sparse_cholesky

Computes Cholesky factorization for sparse matrix A and returns the upper triangular factor U, where A=U^T@U

Classes

ProblemInfo

Problem info dataclass.