quara.objects.effective_lindbladian_typical module

calc_effective_lindbladian_mat_comp_basis_from_hamiltonian(h)[source]

return the HS matrix of an effective Lindbladian w.r.t. the computational basis from a given Hamiltonian.

Parameters

h (np.ndarray((dim, dim), dtype=np.complex128)) – A Hamiltonian, to be an Hermitian matrix.

Returns

The HS matrix of an effective Lindbladian characterized by the Hamiltonian.

Return type

np.ndarray((dim^2, dim^2), dtype=np.complex128)

calc_effective_lindbladian_mat_for_2qubit_hamiltonian_pauli(pauli_type)[source]

Return the HS matrix of effective lindbladian for Hamiltonian with the form of tensor product of two Pauli matrices

Parameters

pauli_type (str) –

Return type

numpy.ndarray

calc_effective_lindbladian_mat_from_hamiltonian(h, to_basis)[source]

return the HS matrix of an effective Lindbladian w.r.t. the given matrix basis from a given Hamiltonian.

Parameters
Returns

The HS matrix of an effective Lindbladian characterized by the Hamiltonian.

Return type

np.ndarray((dim^2, dim^2), dtype=np.complex128)

calc_effective_lindbladian_mat_hermitian_basis_from_hamiltonian(h, to_basis)[source]

return the HS matrix of an effective Lindbladian w.r.t. the given Hermitian matrix basis from a given Hamiltonian.

Parameters
Returns

The HS matrix of an effective Lindbladian characterized by the Hamiltonian.

Return type

np.ndarray((dim^2, dim^2), dtype=np.float128)

calc_hs_commutator_map_i()[source]

Return the HS matrix for an Hermiticity-preserving linear map, \(f_H(A) := {H, A} = HA + AH\), with \(H = I\).

Return type

numpy.ndarray

calc_hs_commutator_map_x()[source]

Return the HS matrix for an Hermiticity-preserving linear map, \(f_H(A) := {H, A} = HA + AH\), with \(H = X\).

Return type

numpy.ndarray

calc_hs_commutator_map_y()[source]

Return the HS matrix for an Hermiticity-preserving linear map, \(f_H(A) := {H, A} = HA + AH\), with \(H = Y\).

Return type

numpy.ndarray

calc_hs_commutator_map_z()[source]

Return the HS matrix for an Hermiticity-preserving linear map, \(f_H(A) := {H, A} = HA + AH\), with \(H = Z\).

Return type

numpy.ndarray

calc_hs_minus1j_anticommutator_map_i()[source]

Return the HS matrix for an Hermiticity-preserving linear map, \(f_H(A) := -i[H, A] = -i(HA - AH)\), with \(H = I\).

Return type

numpy.ndarray

calc_hs_minus1j_anticommutator_map_x()[source]

Return the HS matrix for an Hermiticity-preserving linear map, \(f_H(A) := -i[H, A] = -i(HA - AH)\), with \(H = X\).

Return type

numpy.ndarray

calc_hs_minus1j_anticommutator_map_y()[source]

Return the HS matrix for an Hermiticity-preserving linear map, \(f_H(A) := -i[H, A] = -i(HA - AH)\), with \(H = Y\).

Return type

numpy.ndarray

calc_hs_minus1j_anticommutator_map_z()[source]

Return the HS matrix for an Hermiticity-preserving linear map, \(f_H(A) := -i[H, A] = -i(HA - AH)\), with \(H = Z\).

Return type

numpy.ndarray

generate_effective_lindbladian_from_gate_name(gate_name, c_sys, ids=None, is_physicality_required=True)[source]

returns the Hilbert-Schmidt representation matrix of a gate.

Parameters
  • gate_name (str) – name of gate

  • dims (List[int]) – list of dimentions of elemental systems that the gate acts on.

  • ids (List[int] (optional)) – list of ids for elemental systems

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

  • c_sys (quara.objects.composite_system.CompositeSystem) –

Returns

The effective lindbladian class object of the gate.

Return type

EffectiveLindbladian

generate_effective_lindbladian_mat_for_hamiltonian_x()[source]

Return HS matrix of effective lindbladian for Hamiltonian X, which correspond to a linear map, \(f(A) := -i [ H, A ]\), with \(H = X\).

Return type

numpy.ndarray

generate_effective_lindbladian_mat_for_hamiltonian_y()[source]

Return HS matrix of effective lindbladian for Hamiltonian Y, which correspond to a linear map, \(f(A) := -i [ H, A ]\), with \(H = Y\).

Return type

numpy.ndarray

generate_effective_lindbladian_mat_for_hamiltonian_z()[source]

Return HS matrix of effective lindbladian for Hamiltonian Z, which correspond to a linear map, \(f(A) := -i [ H, A ]\), with \(H = Z\).

Return type

numpy.ndarray

generate_effective_lindbladian_mat_from_gate_name(gate_name, dims=None, ids=None)[source]

returns the Hilbert-Schmidt representation matrix of an effective lindbladian.

Parameters
  • gate_name (str) – name of gate

  • dims (List[int]) – list of dimentions of elemental systems that the gate acts on.

  • ids (List[int] (optional)) – list of ids for elemental systems

Returns

The HS matrix of the effective lindbladian, to be real.

Return type

np.ndarray

generate_effective_lindbladian_object_from_gate_name_object_name(gate_name, object_name, dims=None, ids=None, c_sys=None, is_physicality_required=True)[source]
Parameters
Return type

Union[numpy.ndarray, quara.objects.effective_lindbladian.EffectiveLindbladian]

generate_gate_1qutrit_single_gellmann_effective_linabladian(c_sys, gate_name, is_physicality_required=True)[source]

return the EffectiveLindbladian for the gate.

Parameters
Return type

numpy.ndarray

generate_gate_1qutrit_single_gellmann_effective_lindbladian_mat(gate_name)[source]

return the effective Lindbladian matrix for the gate.

Parameters

gate_name (str) –

Return type

numpy.ndarray

generate_gate_1qutrit_single_gellmann_hamiltonian_vec(gate_name)[source]

return the Hamiltonian vector for the gate.

Parameters

gate_name (str) –

Return type

numpy.ndarray

generate_gate_cx_effective_lindbladian(c_sys, ids, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Control-X gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

  • ids (List[int]) –

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_cx_effective_lindbladian_mat(ids)[source]

Return the HS matrix of the effective lindbladian for a Control-X gate

Parameters

ids (List[int]) –

Return type

numpy.ndarray

generate_gate_cx_hamiltonian_mat(ids)[source]

Return the Hamiltonian of the Control-X gate. The Hamiltonian is \(H = \frac{\pi}{4} (- II + IX - ZI - ZX)\) for ids[0] < ids[1], and \(H = \frac{\pi}{4} (- II + XI - IZ - XZ)\) for ids[0] > ids[1], where ids[0] for control system index and ids[1] for target system index.

Parameters

ids (List[int]) –

Return type

numpy.ndarray

generate_gate_cx_hamiltonian_vec(ids)[source]

Return the vector representation of the Hamiltonian of the Control-X gate. The Hamiltonian is \(H = \frac{\pi}{4} (- II + IX - ZI - ZX)\) for ids[0] < ids[1], and \(H = \frac{\pi}{4} (- II + XI - IZ - XZ)\) for ids[0] > ids[1], where ids[0] for control system index and ids[1] for target system index.

Parameters

ids (List[int]) –

Return type

numpy.ndarray

generate_gate_cz_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Control-Z gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_cz_effective_lindbladian_mat()[source]

Return the HS matrix of the effective lindbladian for a Control-Z gate

Return type

numpy.ndarray

generate_gate_cz_hamiltonian_mat()[source]

Return the Hamiltonian of the Control-Z gate. The Hamiltonian is \(H = \frac{\pi}{4} (- II + IZ + ZI - ZZ)\).

Return type

numpy.ndarray

generate_gate_cz_hamiltonian_vec()[source]

Return the vector representation of the Hamiltonian of the Control-Z gate. The Hamiltonian is \(H = \frac{\pi}{4} (- II + IZ + ZI - ZZ)\).

Return type

numpy.ndarray

generate_gate_hadamard_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Hadamard (H) gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_hadamard_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of an Hadamard (H) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_hadamard_hamiltonian_mat()[source]

Return Hamiltonian matrix for an Hadamard (H) gate.

The result is the 2 times 2 complex matrix, \(-0.25 \pi I + 0.25 \pi X / \sqrt{2}+ 0.25 \pi Z / \sqrt{2}\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_hadamard_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of an Hadamard (H) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_identity_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the identity gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_identity_effective_lindbladian_mat(dim)[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of an Identity gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is the dim^2 times dim^2 real zero matrix.

Parameters

dim (int) – The dimension of the quantum system on which the gate acts.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate. It is the zero matrix in this case.

Return type

np.ndarray

generate_gate_identity_hamiltonian_mat(dim)[source]

Return Hamiltonian matrix for an identity gate.

The result is the dim times dim complex zero matrix.

Parameters

dim (int) – The dimension of the quantum system on which the gate acts.

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_identity_hamiltonian_vec(dim)[source]

Return the vector representation for the Hamiltonian of an identity gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is the real zero vector with size dim^2.

Parameters

dim (int) – The dimension of the quantum system on which the gate acts.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_phase_daggered_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Phase daggered (\(S^\dagger\)) gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_phase_daggered_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a Phase daggered (S^dagger) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_phase_daggered_hamiltonian_mat()[source]

Return Hamiltonian matrix for a Phase daggerd (S^dagger) gate.

The result is the 2 times 2 complex matrix, \(0.25 \pi I - 0.25 \pi Z\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_phase_daggered_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a Phase daggered (S^dagger) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_phase_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Phase (S) gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_phase_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a Phase (S) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_phase_hamiltonian_mat()[source]

Return Hamiltonian matrix for a Phase (S) gate.

The result is the 2 times 2 complex matrix, \(-0.25 \pi I + 0.25 \pi Z\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_phase_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a Phase (S) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_piover8_daggered_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the pi/8 daggered (T^dagger) gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_piover8_daggered_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a pi/8 daggered (T^dagger) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_piover8_daggered_hamiltonian_mat()[source]

Return Hamiltonian matrix for a pi/8 daggerd (T^dagger) gate.

The result is the 2 times 2 complex matrix, \(\frac{\pi}{8} I - \frac{\pi}{8} Z\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_piover8_daggered_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a pi/8 daggered (T^dagger) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_piover8_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the pi/8 (T) gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_piover8_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a pi/8 (T) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_piover8_hamiltonian_mat()[source]

Return Hamiltonian matrix for a pi/8 (T) gate.

The result is the 2 times 2 complex matrix, \(-\frac{\pi}{8} I + \frac{\pi}{8} Z\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_piover8_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a pi/8 (T) gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_swap_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the SWAP gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_swap_effective_lindbladian_mat()[source]

Return the HS matrix of the effective lindbladian for a SWAP gate

Return type

numpy.ndarray

generate_gate_swap_hamiltonian_mat()[source]

Return the Hamiltonian of the SWAP gate. The Hamiltonian is \(H = \frac{\pi}{4} (- II + XX + YY + ZZ)\).

Return type

numpy.ndarray

generate_gate_swap_hamiltonian_vec()[source]

Return the vector representation of the Hamiltonian of the SWAP gate. The Hamiltonian is \(H = \frac{\pi}{4} (- II + XX + YY + ZZ)\).

Return type

numpy.ndarray

generate_gate_x180_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the X180 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_x180_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of an X180 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_x180_hamiltonian_mat()[source]

Return Hamiltonian matrix for an X180 gate.

The result is the 2 times 2 complex matrix, \(0.5 \pi X\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_x180_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of an X180 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_x90_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the X90 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_x90_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of an X90 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_x90_hamiltonian_mat()[source]

Return Hamiltonian matrix for an X90 gate.

The result is the 2 times 2 complex matrix, \(0.25 \pi X\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_x90_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of an X90 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_x_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the X gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_x_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of an X gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_x_hamiltonian_mat()[source]

Return Hamiltonian matrix for an X gate.

The result is the 2 times 2 complex matrix, \(-0.5 \pi I + 0.5 \pi X\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_x_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of an X gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_y180_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Y180 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_y180_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a Y180 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_y180_hamiltonian_mat()[source]

Return Hamiltonian matrix for a Y180 gate.

The result is the 2 times 2 complex matrix, \(0.5 \pi Y\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_y180_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a Y180 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_y90_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Y90 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_y90_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a Y90 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_y90_hamiltonian_mat()[source]

Return Hamiltonian matrix for a Y90 gate.

The result is the 2 times 2 complex matrix, \(0.25 \pi Y\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_y90_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a Y90 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_y_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Y180 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_y_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a Y gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_y_hamiltonian_mat()[source]

Return Hamiltonian for a Y gate.

The result is the 2 times 2 complex matrix, \(-0.5 \pi I + 0.5 \pi Y\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_y_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a Y gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_z180_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Z180 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_z180_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a Z180 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_z180_hamiltonian_mat()[source]

Return Hamiltonian matrix for a Z180 gate.

The result is the 2 times 2 complex matrix, \(0.5 \pi Z\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_z180_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a Z180 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_z90_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Z90 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_z90_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a Z90 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_z90_hamiltonian_mat()[source]

Return Hamiltonian matrix for a Z90 gate.

The result is the 2 times 2 complex matrix, \(0.25 \pi Z\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_z90_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a Z90 gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is the real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_z_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the Z gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_z_effective_lindbladian_mat()[source]

Return the Hilbert-Schmidt representation matrix for the effective Lindbladian of a Z gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a 4 times 4 real matrix.

Returns

The real Hilbert-Schmidt representation matrix for the effective lindbladian of the gate.

Return type

np.ndarray

generate_gate_z_hamiltonian_mat()[source]

Return Hamiltonian matrix for a Z gate.

The result is the 2 times 2 complex matrix, \(-0.5 \pi I + 0.5 \pi Z\).

Returns

The Hamiltonian, which is a complex matrix.

Return type

np.ndarray

generate_gate_z_hamiltonian_vec()[source]

Return the vector representation for the Hamiltonian of a Z gate with respect to the orthonormal Hermitian matrix basis with the normalized identity matrix as the 0th element.

The result is a real vector with size 4.

Returns

The real vector representation of the Hamiltonian of the gate.

Return type

np.ndarray

generate_gate_zx90_effective_lindbladian(c_sys, ids, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the ZX90 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • ids (List[int]) – ids[0] for control system id, and ids[1] for target system id

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_zx90_effective_lindbladian_mat(ids)[source]

Return the HS matrix of the effective lindbladian for a ZX90 gate

Parameters

ids (List[int]) –

Return type

numpy.ndarray

generate_gate_zx90_hamiltonian_mat(ids)[source]

Return the Hamiltonian of the ZX90 gate. The Hamiltonian is \(H = \frac{\pi}{4} ZX\) for ids[0] < ids[1], and \(H = \frac{\pi}{4} XZ\) for ids[0] > ids[1], where ids[0] for control system index and ids[1] for target system index.

Parameters

ids (List[int]) –

Return type

numpy.ndarray

generate_gate_zx90_hamiltonian_vec(ids)[source]

Return the vector representation of the Hamiltonian of the ZX90 gate. The Hamiltonian is \(H = \frac{\pi}{4} ZX\) for ids[0] < ids[1], and \(H = \frac{\pi}{4} XZ\) for ids[0] > ids[1], where ids[0] for control system index and ids[1] for target system index.

Parameters

ids (List[int]) –

Return type

numpy.ndarray

generate_gate_zz90_effective_lindbladian(c_sys, is_physicality_required=True)[source]

Return the class EffectiveLindbladian for the ZZ90 gate on the composite system.

Parameters
  • c_sys (CompositeSystem) – The class CompositeSystem on which the gate acts.

  • is_physicality_required (bool = True) – whether the generated object is physicality required, by default True

Returns

The effective Lindbladian of the gate.

Return type

EffectiveLindbladian

generate_gate_zz90_effective_lindbladian_mat()[source]

Return the HS matrix of the effective lindbladian for a ZZ90 gate

Return type

numpy.ndarray

generate_gate_zz90_hamiltonian_mat()[source]

Return the Hamiltonian of a ZZ90 gate. The Hamiltonian is \(H = \frac{\pi}{4} ZZ\).

Return type

numpy.ndarray

generate_gate_zz90_hamiltonian_vec()[source]

Return the vector representation of the Hamiltonian of a ZZ90 gate. The Hamiltonian is \(H = \frac{\pi}{4} ZZ\).

Return type

numpy.ndarray

generate_hamiltonian_mat_from_gate_name(gate_name, dims=None, ids=None)[source]

returns the Hamiltonian matrix of a gate.

Parameters
  • gate_name (str) – name of gate

  • dims (List[int]) – list of dimentions of elemental systems that the gate acts on.

  • ids (List[int] (optional)) – list of ids for elemental systems

Returns

The Hamiltonian matrix the gate, to be complex.

Return type

np.ndarray

generate_hamiltonian_vec_from_gate_name(gate_name, dims=None, ids=None)[source]

return the vector representation of the Hamiltonian of a gate.

Parameters
  • gate_name (str) – name of gate

  • dims (List[int]) – list of dimentions of elemental systems that the gate acts on.

  • ids (List[int] (optional)) – list of ids for elemental systems

Returns

The vector for the Hamiltonian matrix, to be real.

Return type

np.ndarray