@@ -28,15 +28,15 @@ def pauli_basis(
28
28
vectorize (bool, optional): If ``False``, returns a nested array with
29
29
all Pauli matrices. If ``True``, retuns an array where every
30
30
row is a vectorized Pauli matrix. Defaults to ``False``.
31
- sparse (bool, optional) If ``True``, retuns Pauli basis in a sparse
32
- representation. Default is ``False``.
31
+ sparse (bool, optional): If ``True``, retuns Pauli basis in a sparse
32
+ representation. Defaults to ``False``.
33
33
order (str, optional): If ``"row"``, vectorization of Pauli basis is
34
34
performed row-wise. If ``"column"``, vectorization is performed
35
35
column-wise. If ``"system"``, system-wise vectorization is
36
36
performed. If ``vectorization=False``, then ``order=None`` is
37
- forced. Default is ``None``.
37
+ forced. Defaults to ``None``.
38
38
pauli_order (str, optional): corresponds to the order of 4 single-qubit
39
- Pauli elements. Default is "IXYZ".
39
+ Pauli elements. Defaults to `` "IXYZ"`` .
40
40
backend (:class:`qibo.backends.abstract.Backend`, optional): backend
41
41
to be used in the execution. If ``None``, it uses
42
42
:class:`qibo.backends.GlobalBackend`. Defaults to ``None``.
@@ -148,15 +148,12 @@ def comp_basis_to_pauli(
148
148
The unitary :math:`U` is given by
149
149
150
150
.. math::
151
- U = \\ sum_{k = 0}^{d^{2} - 1} \\ , \\ ketbra{k}{ P_{k}} \\ ,\\ , ,
151
+ U = \\ sum_{k = 0}^{d^{2} - 1} \\ , |k)( P_{k}| \\ ,\\ , ,
152
152
153
- where :math:`\\ ket{P_{k}}` is the system-vectorization of the :math:`k`-th
154
- Pauli operator :math:`P_{k}`, and :math:`\\ ket{k}` is the computational
155
- basis element.
156
-
157
- When converting a state :math:`\\ ket{\\ rho}` to its Pauli-Liouville
158
- representation :math:`\\ ket{\\ rho'}`, one should use ``order="system"``
159
- in :func:`vectorization`.
153
+ where :math:`|P_{k})` is the vectorization of the :math:`k`-th
154
+ Pauli operator :math:`P_{k}`, and :math:`|k)` is the vectorization
155
+ of the :math:`k`-th computational basis element.
156
+ For a definition of vectorization, see :func:`qibo.quantum_info.vectorization`.
160
157
161
158
Example:
162
159
.. code-block:: python
@@ -174,13 +171,13 @@ def comp_basis_to_pauli(
174
171
normalize (bool, optional): If ``True``, converts to the
175
172
Pauli basis. Defaults to ``False``.
176
173
sparse (bool, optional): If ``True``, returns unitary matrix in
177
- sparse representation. Default is ``False``.
174
+ sparse representation. Defaults to ``False``.
178
175
order (str, optional): If ``"row"``, vectorization of Pauli basis is
179
176
performed row-wise. If ``"column"``, vectorization is performed
180
177
column-wise. If ``"system"``, system-wise vectorization is
181
- performed. Default is ``"row"``.
178
+ performed. Defaults to ``"row"``.
182
179
pauli_order (str, optional): corresponds to the order of 4 single-qubit
183
- Pauli elements. Default is "IXYZ".
180
+ Pauli elements. Defaults to `` "IXYZ"`` .
184
181
backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be
185
182
used in the execution. If ``None``, it uses
186
183
:class:`qibo.backends.GlobalBackend`. Defaults to ``None``.
@@ -237,20 +234,25 @@ def pauli_to_comp_basis(
237
234
The unitary :math:`U` is given by
238
235
239
236
.. math::
240
- U = \\ sum_{k = 0}^{d^{2} - 1} \\ , \\ ketbra{P_{k}}{b_{k}} \\ , .
237
+ U = \\ sum_{k = 0}^{d^{2} - 1} \\ , |P_{k})(b_{k}| \\ , ,
238
+
239
+ where :math:`|P_{k})` is the vectorization of the :math:`k`-th
240
+ Pauli operator :math:`P_{k}`, and :math:`|k)` is the vectorization
241
+ of the :math:`k`-th computational basis element.
242
+ For a definition of vectorization, see :func:`qibo.quantum_info.vectorization`.
241
243
242
244
Args:
243
245
nqubits (int): number of qubits.
244
246
normalize (bool, optional): If ``True``, converts to the
245
247
Pauli basis. Defaults to ``False``.
246
248
sparse (bool, optional): If ``True``, returns unitary matrix in
247
- sparse representation. Default is ``False``.
249
+ sparse representation. Defaults to ``False``.
248
250
order (str, optional): If ``"row"``, vectorization of Pauli basis is
249
251
performed row-wise. If ``"column"``, vectorization is performed
250
252
column-wise. If ``"system"``, system-wise vectorization is
251
- performed. Default is ``"row"``.
253
+ performed. Defaults to ``"row"``.
252
254
pauli_order (str, optional): corresponds to the order of 4 single-qubit
253
- Pauli elements. Default is "IXYZ".
255
+ Pauli elements. Defaults to `` "IXYZ"`` .
254
256
backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be
255
257
used in the execution. If ``None``, it uses
256
258
:class:`qibo.backends.GlobalBackend`. Defaults to ``None``.
0 commit comments