mindquantum.algorithm.library.mat_to_op ======================================================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.5.0/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindquantum/blob/r0.10/docs/api_python/algorithm/library/mindquantum.algorithm.library.mat_to_op.rst :alt: 查看源文件 .. py:function:: mindquantum.algorithm.library.mat_to_op(mat, little_endian: bool = True) 将一个基于qubit的矩阵表示转换为对应的泡利算符表示。默认以小端头表示输出QubitOperator。 参数: - **mat** - 基于qubit的矩阵表示。 - **little_endian** (bool) - 是否使用小端头表示(默认为True,即小端头表示)。如果为True,则表示最高位Qubit为最左边的位(即小端头表示),否则表示最高位Qubit为最右边的位(即大端头表示) 返回: :class:`~.core.operators.QubitOperator`,对应的泡利算符表示的QubitOperator。