quara.interface.qulacs.conversion module
- convert_gate_quara_to_qulacs(quara_gate, qubits)[source]
converts Quara Gate object into Qulacs CPTP object.
- Parameters
quara_gate (Gate) –
qubits (List[int]) –
- Returns
Qulacs CPTP object which Kraus-represented matrices are stored.
- Return type
CPTP
- convert_instrument_quara_to_qulacs(quara_mprocess, qubits)[source]
converts Quara State into Qulacs Instrument in form of Lists of Kraus operators
- Parameters
quara_mprocess (MProcess) – Quara MProcess object.
qubits (List[int]) – List of indices of qubits which intruments are assosiated to.
- Returns
Qulacs Instrument object and list of number of matrices for every Kraus-represented operators.
- Return type
Tuple[Instrument, List[int]]
- convert_state_quara_to_qulacs(quara_state)[source]
converts Quara State into Qulacs DensityMatrix.
- Parameters
qulacs_density_mat (DensityMatrix) – DensityMatrix object in Qulacs.
c_sys (CompositeSystem) – CompositeSystem containing state.
quara_state (quara.objects.state.State) –
- Returns
Quara State.
- Return type
- convert_state_qulacs_to_quara(qulacs_density_mat, c_sys)[source]
converts Qulacs DensityMatrix into Quara State.
- Parameters
qulacs_density_mat (DensityMatrix) – DensityMatrix object in Qulacs.
c_sys (CompositeSystem) – CompositeSystem containing state.
- Returns
Quara State.
- Return type
- get_index_tuple_from_kraus_matrices_indices(index, indices)[source]
Get index i, j of Instrument object from a list of numbers corresponding to matrices of Kraus operators.
- Parameters
index (int) – Index of the matrix in a list of matrices of Kraus operators.
indices (List[int]) – List of numbers of matrices per Kraus operator.
- Returns
returns (i, j) meaning that j-th matrix of i-th Kraus operator.
- Return type
Tuple[int, int]