quara.objects.composite_system module¶
- class CompositeSystem(systems)[source]¶
Bases:
objectClass 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
- basis_basisconjugate(basis_index)[source]¶
returns \(B_{\alpha} \otimes \bar{B_{\beta}}\), where basis_index = \((\alpha, \beta)\) and \(B_{i}\) are the elements of basis.
- Parameters
basis_index (Union[int, Tuple[int, int]]) –
index of basis.
if type is int, then regardes it as the indices (basis_index / num_of_basis, basis_index % num_of_basis) of the basis of CompositeSystem.
if type is Tuple, then regardes (i, j) as the indices of the basis of CompositeSystem.
- Returns
\(B_{\alpha} \otimes \bar{B_{\beta}}\)
- Return type
np.ndarray
- comp_basis(mode='row_major')[source]¶
returns computational basis of CompositeSystem.
- Parameters
mode (str, optional) – specify whether the order of basis is “row_major” or “column_major”, by default “row_major”.
- Returns
computational basis of CompositeSystem.
- Return type
- Raises
ValueError –
modeis unsupported.
- 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
- 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