quara.objects.composite_system module

class CompositeSystem(systems)[source]

Bases: object

Class for describing Composite system

Constructor

Parameters

systems (List[ElementalSystem]) – list of ElementalSystem of this CompositeSystem.

Raises
  • ValueError – duplicate ElementalSystem instance.

  • ValueError – duplicate ElementalSystem name.

basis()[source]

returns MatrixBasis of CompositeSystem.

Returns

MatrixBasis of CompositeSystem.

Return type

MatrixBasis

comp_basis()[source]

returns computational basis of CompositeSystem.

Returns

computational basis of CompositeSystem.

Return type

MatrixBasis

property dim: int

returns dim of CompositeSystem.

the dim of CompositeSystem equals the dim of basis.

Returns

dim of CompositeSystem.

Return type

int

dim_e_sys(i)[source]

returns the dimension of the i-th ElementalSystem.

the dim of the i-th ElementalSystem.

Parameters

i (int) – the id of an ElementalSystem

Returns

the dim of the i-th ElementalSystem

Return type

int

property elemental_systems: Tuple[quara.objects.elemental_system.ElementalSystem]

returns list of ElementalSystem of this CompositeSystem.

Returns

list of ElementalSystem of this CompositeSystem.

Return type

Tuple[ElementalSystem]

get_basis(index)[source]

returns basis specified by index.

Parameters

index (Union[int, Tuple]) – index of basis. if type is int, then regardes it as the index after calculating the basis of CompositeSystem. if type is Tuple, then regardes it as the indices of the basis of ElementalSystems.

Returns

basis specified by index.

Return type

MatrixBasis

Raises
  • ValueError – length of tuple does not equal length of the list of the basis.

  • IndexError – specified index does not exist in the list of the basis.

property is_basis_hermitian: bool
property is_orthonormal_hermitian_0thprop_identity: bool

returns whether all ElementalSystem of this CompositeSystem are orthonormal, hermitian and 0th prop identity.

Returns

whether all ElementalSystem of this CompositeSystem are orthonormal, hermitian and 0th prop identity.

Return type

bool

property num_e_sys: int

returns the number of ElementalSystem.

the number of ElementalSystem.

Returns

num of ElementalSystem.

Return type

int