-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request !2323 from donghufeng/r0.10
- Loading branch information
Showing
25 changed files
with
842 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
docs/api_python/algorithm/library/mindquantum.algorithm.library.mat_to_op.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
mindquantum.algorithm.library.mat_to_op | ||
======================================================= | ||
|
||
.. py:function:: mat_to_op(mat, little_endian: bool = True) | ||
将一个基于qubit的矩阵表示转换为对应的泡利算符表示。默认以小端头表示输出QubitOperator。 | ||
|
||
参数: | ||
- **mat** - 基于qubit的矩阵表示。 | ||
- **little_endian** - 是否使用小端头表示(默认为True,即小端头表示)。如果为True,则表示最高位Qubit为最左边的位(即小端头表示),否则表示最高位Qubit为最右边的位(即大端头表示) | ||
|
||
返回: | ||
:class:`~.core.QubitOperator`, 对应的泡利算符表示的QubitOperator。 |
23 changes: 23 additions & 0 deletions
23
...on/algorithm/library/mindquantum.algorithm.library.qudit_symmetric_decoding.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
mindquantum.algorithm.library.qudit_symmetric_decoding | ||
======================================================== | ||
|
||
.. py:function:: qudit_symmetric_decoding(qubit: np.ndarray, n_qubits: int = 1) | ||
对称性解码,将qubit对称态或矩阵解码成qudit态或矩阵。 | ||
|
||
.. math:: | ||
\begin{align} | ||
\ket{00\cdots00}&\to\ket{0} \\[.5ex] | ||
\frac{\ket{0\cdots01}+\ket{0\cdots010}+\ket{10\cdots0}}{\sqrt{d-1}}&\to\ket{1} \\ | ||
\frac{\ket{0\cdots011}+\ket{0\cdots0101}+\ket{110\cdots0}}{\sqrt{d-1}}&\to\ket{2} \\ | ||
\vdots&\qquad\vdots \\[.5ex] | ||
\ket{11\cdots11}&\to\ket{d-1} | ||
\end{align} | ||
参数: | ||
- **qubit** (np.ndarray) - 需要解码的qubit对称态或矩阵,qubit态或矩阵需满足对称性。 | ||
- **n_qubits** (int) - qubit对称态或矩阵的量子比特数。默认值:``1``。 | ||
|
||
返回: | ||
np.ndarray,对称性解码后的qudit态或矩阵。 |
23 changes: 23 additions & 0 deletions
23
...on/algorithm/library/mindquantum.algorithm.library.qudit_symmetric_encoding.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
mindquantum.algorithm.library.qudit_symmetric_encoding | ||
======================================================== | ||
|
||
.. py:function:: qudit_symmetric_encoding(qudit: np.ndarray, n_qudits: int = 1) | ||
对称性编码,将qudit态或矩阵编码成qubit对称态或矩阵。 | ||
|
||
.. math:: | ||
\begin{align} | ||
\ket{0}&\to\ket{00\cdots00} \\[.5ex] | ||
\ket{1}&\to\frac{\ket{0\cdots01}+\ket{0\cdots010}+\ket{10\cdots0}}{\sqrt{d-1}} \\ | ||
\ket{2}&\to\frac{\ket{0\cdots011}+\ket{0\cdots0101}+\ket{110\cdots0}}{\sqrt{d-1}} \\ | ||
\vdots&\qquad\vdots \\[.5ex] | ||
\ket{d-1}&\to\ket{11\cdots11} | ||
\end{align} | ||
参数: | ||
- **qudit** (np.ndarray) - 需要编码的qudit态或矩阵。 | ||
- **n_qudits** (int) - qudit态或矩阵的量子位个数。默认值:``1``。 | ||
|
||
返回: | ||
np.ndarray,对称性编码后的qubit对称态或矩阵。 |
18 changes: 18 additions & 0 deletions
18
...hon/algorithm/library/mindquantum.algorithm.library.qutrit_symmetric_ansatz.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
mindquantum.algorithm.library.qutrit_symmetric_ansatz | ||
======================================================= | ||
|
||
.. py:function:: qutrit_symmetric_ansatz(gate: UnivMathGate, basis: str = "zyz", with_phase: bool = False) | ||
构造一个保持任意qutrit门编码对称性的qubit ansatz。 | ||
|
||
参考文献: | ||
`Synthesis of multivalued quantum logic circuits by elementary gates <https://journals.aps.org/pra/abstract/10.1103/PhysRevA.87.012325>`_, | ||
`Optimal synthesis of multivalued quantum circuits <https://journals.aps.org/pra/abstract/10.1103/PhysRevA.92.062317>`_。 | ||
|
||
参数: | ||
- **gate** (:class:`~.core.gates.UnivMathGate`) - 由qutrit门编码而来的qubit门。 | ||
- **basis** (str) - 分解的基,可以是 ``"zyz"`` 或者 ``"u3"`` 中的一个。默认值: ``"zyz"``。 | ||
- **with_phase** (bool) - 是否将全局相位以 :class:`~.core.gates.GlobalPhase` 的形式作用在量子线路上。默认值: ``False``。 | ||
|
||
返回: | ||
:class:`~.core.circuit.Circuit`,保持qutrit编码对称性的qubit ansatz。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.