N

class N(subsystems)[source]

Bases: AbstractSubsystemOperator

The number operator.

Defined as the diagonal matrix with with entries [0, ..., dim - 1], where dim is the dimension of the Subsystem the operator is defined on.

Initialize with the list of subsystems the operator acts on.

Methods

base_matrix()[source]

Return the matrix defined on the internal subsystems.

matrix(ordered_subsystems=None)

Build the matrix for the operator relative to the ordered subsystems.

remove_subsystems(subsystems)

Return operator with subsystems removed.

Components of operators with support on removed subsystems will be set to 0.

Return type:

AbstractSubsystemOperator

restrict_subsystems(subsystems)

Reduce the operator to the list of subsystems.

Components of operators with support on removed subsystems will be set to 0.

Return type:

AbstractSubsystemOperator

Attributes

subsystems

Get the subsystems the operator acts on.