qoqo_calculator_pyo3

Functions

parse_string_assign(expression)

Classes

Calculator()

CalculatorComplex(input)

CalculatorFloat(input)

class qoqo_calculator_pyo3.Calculator
parse_get(input)

Parse an input to float.

# Arguments

  • input - Parsed string CalculatorFloat or returns float value

parse_str(input)

Parse a string expression.

# Arguments

  • input - Expression that is parsed

parse_str_assign(input)

Parse a string expression.

# Arguments

  • input - Expression that is parsed

set(variable_string, val)

Set variable for Calculator.

# Arguments

  • variable_string - string of the variable name

  • val - Float value of the variable

class qoqo_calculator_pyo3.CalculatorComplex(input)
abs()

Return absolute value of complex number x: |x|=(x.re^2+x.im^2)^1/2.

arg()

Return phase of complex number x: arg(x).

conj()

Return complex conjugate of x: x*=x.re-i*x.im.

static from_pair(re, im)

Create a new instance of CalculatorComplex from a pair of values.

imag

Get imaginary part of CalculatorComplex.

isclose(other)

Return true when x is close to y.

real

Get real part of CalculatorComplex.

to_dict()

Convert contents of CalculatorComplex to a Python dictionary.

class qoqo_calculator_pyo3.CalculatorFloat(input)
abs()

Return absolute value abs(x) for CalculatorFloat.

acos()

Return arccosine function acos(x) for CalculatorFloat.

atan2(other)

Return atan2 for CalculatorFloat and generic type Py<PyAny>.

# Arguments

  • other - Any Python object that can be converted to CalculatorFloat

cos()

Return cosine function cos(x) for CalculatorFloat.

exp()

Return exponential function exp(x) for CalculatorFloat.

float()

Python getter function which returns True when CalculatorFloat does not contain symbolic expression.

is_float

Python getter function which returns True when CalculatorFloat does not contain symbolic expression.

isclose(other)

Return True if self value is close to other value.

sign()

Returns signum value sign(x) for CalculatorFloat.

signum()

Return signum value sign(x) for CalculatorFloat.

sin()

Return sine function sin(x) for CalculatorFloat.

sqrt()

Returns square root of CalculatorFloat.

value

Python getter function which returns the value stored in CalculatorFloat.

qoqo_calculator_pyo3.parse_string_assign(expression)