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
SparseMatrixBasis of CompositeSystem.
- Return type
- property basis_T_sparse: numpy.ndarray
- 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
- property basis_basisconjugate_T_sparse: numpy.ndarray
- property basis_basisconjugate_T_sparse_from_1: numpy.ndarray
- property basisconjugate_basis_sparse: numpy.ndarray
- property basisconjugate_sparse: numpy.ndarray
- property basishermitian_basis_T_from_1: numpy.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.
- delete_basis_T_sparse()[source]
delete
basis_T_sparseproperty to save memory.If you use
basis_T_sparseagain, callbasis_T_sparseagain.- Return type
None
- delete_basis_basisconjugate_T_sparse()[source]
delete
basis_basisconjugate_T_sparseproperty to save memory.If you use
basis_basisconjugate_T_sparseagain, callbasis_basisconjugate_T_sparseagain.- Return type
None
- delete_basis_basisconjugate_T_sparse_from_1()[source]
delete
basis_basisconjugate_T_sparse_from_1property to save memory.If you use
basis_basisconjugate_T_sparse_from_1again, callbasis_basisconjugate_T_sparse_from_1again.- Return type
None
- delete_basisconjugate_basis_sparse()[source]
delete
basisconjugate_basis_sparseproperty to save memory.If you use
basisconjugate_basis_sparseagain, callbasisconjugate_basis_sparseagain.- Return type
None
- delete_basisconjugate_sparse()[source]
delete
basisconjugate_sparseproperty to save memory.If you use
basisconjugate_sparseagain, callbasisconjugate_sparseagain.- Return type
None
- delete_basishermitian_basis_T_from_1()[source]
delete
basishermitian_basis_T_from_1property to save memory.If you use
basishermitian_basis_T_from_1again, callbasishermitian_basis_T_from_1again.- Return type
None
- delete_dict_from_choi_to_hs()[source]
delete
dict_from_choi_to_hsproperty to save memory.If you use
dict_from_choi_to_hsagain, calldict_from_choi_to_hsagain.- Return type
None
- delete_dict_from_hs_to_choi()[source]
delete
dict_from_hs_to_choiproperty to save memory.If you use
dict_from_hs_to_choiagain, calldict_from_hs_to_choiagain.- Return type
None
- property dict_from_choi_to_hs: dict
- property dict_from_hs_to_choi: dict
- 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