Skip to content
Pasqal Documentation

Variable

class pulser.parametrized.Variable(name, dtype, size=1)

Bases: Parametrized, OpSupport

A variable for parametrized sequence building.

Parameters:
  • name (str) – Unique name for the variable.

  • dtype (type[float] | type[int]) – Type of the variable’s content. Supports float and int.

  • size (int, default: 1) – The number of values stored. Defaults to a single value.

Attributes

size

variables

Returns a dictionary with the only variable involved (itself).

name

dtype

Methods

build

Returns the variable's current value.

cos

Calculates the trigonometric cosine of the object.

exp

Calculates the exponential of the object.

log

Calculates the natural logarithm of the object.

log2

Calculates the base-2 logarithm of the object.

rint

Rounds the value to the nearest int.

sin

Calculates the trigonometric sine of the object.

sqrt

Calculates the square root of the object.

tan

Calculates the trigonometric tangent of the object.

tanh

Calculates the hyperbolic tangent of the object.

Signatures

build()

Returns the variable’s current value.

Return type:

AbstractArray

cos()

Calculates the trigonometric cosine of the object.

Return type:

ParamObj

exp()

Calculates the exponential of the object.

Return type:

ParamObj

log()

Calculates the natural logarithm of the object.

Return type:

ParamObj

log2()

Calculates the base-2 logarithm of the object.

Return type:

ParamObj

rint()

Rounds the value to the nearest int.

Return type:

ParamObj

sin()

Calculates the trigonometric sine of the object.

Return type:

ParamObj

sqrt()

Calculates the square root of the object.

Return type:

ParamObj

tan()

Calculates the trigonometric tangent of the object.

Return type:

ParamObj

tanh()

Calculates the hyperbolic tangent of the object.

Return type:

ParamObj

property variables: dict[str, Variable]

Returns a dictionary with the only variable involved (itself).