{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Noise Simulator\n", "\n", "[![Download Notebook](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_notebook_en.svg)](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/notebook/master/mindquantum/en/middle_level/mindspore_noise_simulator.ipynb) \n", "[![Download Code](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_download_code_en.svg)](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/notebook/master/mindquantum/en/middle_level/mindspore_noise_simulator.py) \n", "[![View source on Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/master/docs/mindquantum/docs/source_en/middle_level/noise_simulator.ipynb)\n", "\n", "MindQuantum contains a variety of noisy channels with which we can simulate real quantum chips. In MindQuantum, we define various [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html), and can selectively add noisy channels at different locations of the quantum line to complete the noisy quantum simulation sequentially. The following describes how to accomplish this task using MindQuantum.\n", "\n", "## [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html)\n", "\n", "[ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html) is a processor that can add specific channels at specific positions in the quantum circuit, such as adding a bit flip channel after a measurement gate. The [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html) class mainly consists of three functions: `_accepter()`, `_excluder()`, and `_handler(BasicGate)`, whose functions are as follows:\n", "\n", "- `_accepter()`: Returns a list of functions called the accept rule set, where each accept rule function takes a quantum gate as input. When the function returns `True`, we can add a channel after that quantum gate.\n", "\n", "- `_excluder()`: Returns a list of functions called the reject rule set, where each reject rule function takes a quantum gate as input. When the function returns `True`, we reject adding a channel after that quantum gate.\n", "\n", "- `_handler(BasicGate)`: Takes a quantum gate as input and returns a section of the quantum circuit that represents a custom channel added after the input quantum gate.\n", "\n", "We redefine the `__call__` function of the [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html) class and you can directly call [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html) to generate the processed quantum circuit.\n", "Here are several types of [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html).\n", "\n", "### [BitFlipAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.BitFlipAdder.html)\n", "\n", "The interface definition of [BitFlipAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.BitFlipAdder.html) is:\n", "\n", "```python\n", "BitFlipAdder(flip_rate: float, with_ctrl=True, focus_on: int = None, add_after: bool = True)\n", "```\n", "\n", "This `Adder` adds a bit flip channel after a quantum gate. The arguments of the interface are:\n", "\n", "- **flip_rate** (float): The flip probability of the bit flip channel.\n", "- **with_ctrl** (bool): Whether to add bits on the control bit. Default value: ``True``.\n", "- **focus_on** (bool): Only apply this noise channel to ``focus_on`` bits. If it is ``None``, it will act on all bits of the quantum gate. Default value: ``None``.\n", "- **add_after** (bool): Whether to add the channel after the quantum gate. If it is ``False``, the channel will be added before the quantum gate. Default value: ``True``.\n", "\n", "For example, we can add a bit flip channel with a flip probability of ``0.3`` after each quantum gate in the given quantum circuit:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "q0: q1: H RX a Z " ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from mindquantum.core.circuit.channel_adder import BitFlipAdder\n", "from mindquantum.core import gates as G\n", "from mindquantum.core.circuit import Circuit\n", "\n", "circ = Circuit()+G.H(0)+G.RX('a').on(1)+G.Z(1, 0)\n", "circ.svg()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "q0: q1: H BFC p=3/10 RX a BFC p=3/10 Z BFC p=3/10 " ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bit_flip_adder = BitFlipAdder(0.3, with_ctrl=False)\n", "new_circ = bit_flip_adder(circ)\n", "new_circ.svg()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### [MeasureAccepter](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.MeasureAccepter.html)\n", "\n", "```python\n", "MeasureAccepter()\n", "```\n", "\n", "This `Adder` selects corresponding measurement gates. It is currently only an `Accepter` and does not change any gates in the quantum circuit. It needs to be used with other `Adders` such as [MixerAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.MixerAdder.html)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### [MixerAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.MixerAdder.html)\n", "\n", "```python\n", "MixerAdder(adders: typing.List[ChannelAdderBase])\n", "```\n", "\n", "[MixerAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.MixerAdder.html) can mix multiple `Adder`s to ensure that the quantum gates are added in sequence according to the `_handler` generated by each `Adder` when the accept function set and reject function set of each quantum gate in each `Adder` are satisfied at the same time.\n", "\n", "For example, we can mix [BitFlipAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.BitFlipAdder.html) and [MeasureAccepter](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.MeasureAccepter.html) mentioned above to achieve the function of adding bit flip channels only before measurement gates:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "MixerAdder<\n", " BitFlipAdder\n", " MeasureAccepter<>\n", ">\n" ] }, { "data": { "image/svg+xml": [ "q0: q1: H RX a Z " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": [ "q0: q1: H RX a Z BFC p=1/100 " ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import display_svg\n", "from mindquantum.core.circuit.channel_adder import MixerAdder, MeasureAccepter\n", "\n", "mixer = MixerAdder([\n", " BitFlipAdder(flip_rate=0.01),\n", " MeasureAccepter(),\n", "], add_after=False)\n", "print(mixer)\n", "\n", "circ = Circuit() + G.H(0) + G.RX('a').on(1) + G.Z(1, 0) + G.Measure().on(0)\n", "display_svg(circ.svg())\n", "new_circ = mixer(circ)\n", "new_circ.svg()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### [SequentialAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.SequentialAdder.html)\n", "\n", "```python\n", "SequentialAdder(adders: typing.List[ChannelAdderBase])\n", "```\n", "\n", "[SequentialAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.SequentialAdder.html) is a class composed of multiple `Adder`s in sequence. The quantum circuit will be processed by the `Adder`s in [SequentialAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.SequentialAdder.html) in turn to generate the final quantum circuit. For example, we want to construct a quantum circuit that first adds a bit flip channel with $p=0.01$ before the measurement gate, and then adds a depolarizing channel with $p=0.05$ after the non-measurement gate and non-noise channel on the `q1` bit.\n", "\n", "### Custom `Adder`\n", "\n", "First, we customize an `Adder` that adds a bit flip channel to a specific bit:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SequentialAdder<\n", " MixerAdder<\n", " MeasureAccepter<>\n", " BitFlipAdder\n", " >\n", " CustomDepolarizingAdder\n", ">\n" ] } ], "source": [ "from mindquantum.core.circuit.channel_adder import ChannelAdderBase, SequentialAdder\n", "\n", "class CustomDepolarizingAdder(ChannelAdderBase):\n", " def __init__(self, q, p):\n", " self.q = q\n", " self.p = p\n", " super().__init__()\n", "\n", " def _accepter(self):\n", " return [lambda x: self.q in x.obj_qubits or self.q in x.ctrl_qubits]\n", "\n", " def _excluder(self):\n", " return [lambda x: isinstance(x, (G.Measure, G.NoiseGate))]\n", "\n", " def _handler(self, g):\n", " return Circuit([G.DepolarizingChannel(self.p).on(self.q)])\n", "\n", " def __repr__(self):\n", " return f\"CustomDepolarizingAdder\"\n", "\n", "seq_adder = SequentialAdder([\n", " MixerAdder([\n", " MeasureAccepter(),\n", " BitFlipAdder(flip_rate=0.01),\n", " ], add_after=False),\n", " CustomDepolarizingAdder(q=1, p=0.05),\n", "])\n", "print(seq_adder)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "q0: q1: H RX a Z " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": [ "q0: q1: H RX a DC p=1/20 Z DC p=1/20 BFC p=1/100 " ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "circ = Circuit() + G.H(0) + G.RX('a').on(1) + G.Z(1, 0) + G.Measure().on(0)\n", "display_svg(circ.svg())\n", "new_circ = seq_adder(circ)\n", "new_circ.svg()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The custom quantum channel above can also be constructed using the predefined channels in MindQuantum." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SequentialAdder<\n", " MixerAdder<\n", " MeasureAccepter<>\n", " BitFlipAdder\n", " >\n", " MixerAdder<\n", " ReverseAdder<\n", " MeasureAccepter<>\n", " >\n", " NoiseExcluder<>\n", " NoiseChannelAdder\n", " >\n", ">\n" ] } ], "source": [ "from mindquantum.core.circuit import ReverseAdder, NoiseExcluder, NoiseChannelAdder\n", "seq_adder = SequentialAdder([\n", " MixerAdder([\n", " MeasureAccepter(),\n", " BitFlipAdder(flip_rate=0.01),\n", " ], add_after=False),\n", " MixerAdder([\n", " ReverseAdder(MeasureAccepter()),\n", " NoiseExcluder(),\n", " NoiseChannelAdder(G.DepolarizingChannel(0.05), focus_on=1),\n", " ])\n", "])\n", "print(seq_adder)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "q0: q1: H RX a DC p=1/20 Z DC p=1/20 BFC p=1/100 " ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "seq_adder(circ).svg()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### A More Complex Example\n", "\n", "We now build a more complex [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html) example where the noise of single qubit gate operations on different bits of the chip can be ignored, while the two qubit gates have different depolarizing channels on different bits, and the measurement of the circuit has a bit flip error with a flip probability of 0.01.\n", "\n", "We assume that the depolarizing channels on different bits are:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "dc0 = G.DepolarizingChannel(0.01)\n", "dc1 = G.DepolarizingChannel(0.02)\n", "dc2 = G.DepolarizingChannel(0.03)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Then we define an `Adder` that meets the requirements:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "SequentialAdder<\n", " MixerAdder<\n", " NoiseExcluder<>\n", " ReverseAdder<\n", " MeasureAccepter<>\n", " >\n", " QubitNumberConstrain\n", " NoiseChannelAdder\n", " >\n", " MixerAdder<\n", " NoiseExcluder<>\n", " ReverseAdder<\n", " MeasureAccepter<>\n", " >\n", " QubitNumberConstrain\n", " NoiseChannelAdder\n", " >\n", " MixerAdder<\n", " NoiseExcluder<>\n", " ReverseAdder<\n", " MeasureAccepter<>\n", " >\n", " QubitNumberConstrain\n", " NoiseChannelAdder\n", " >\n", " MixerAdder<\n", " NoiseExcluder<>\n", " MeasureAccepter<>\n", " BitFlipAdder\n", " >\n", ">" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from mindquantum.core.circuit import QubitNumberConstrain\n", "noise_adder = SequentialAdder([\n", " MixerAdder([\n", " NoiseExcluder(),\n", " ReverseAdder(MeasureAccepter()),\n", " QubitNumberConstrain(2),\n", " NoiseChannelAdder(dc0, focus_on=0),\n", " ]),\n", " MixerAdder([\n", " NoiseExcluder(),\n", " ReverseAdder(MeasureAccepter()),\n", " QubitNumberConstrain(2),\n", " NoiseChannelAdder(dc1, focus_on=1),\n", " ]),\n", " MixerAdder([\n", " NoiseExcluder(),\n", " ReverseAdder(MeasureAccepter()),\n", " QubitNumberConstrain(2),\n", " NoiseChannelAdder(dc2, focus_on=2),\n", " ]),\n", " MixerAdder([\n", " NoiseExcluder(),\n", " MeasureAccepter(),\n", " BitFlipAdder(0.01)\n", " ], add_after=False),\n", "])\n", "noise_adder" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Suppose the quantum circuit we want to process is the first-order Trotter approximation circuit of the time-evolving Hamiltonian\n", "\n", "$$H=a_{01} Z_0Z_1 + a_{12} Z_1Z_2 + b_0 X_0 + b_1 X_1 + b_2 X_2$$" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ " b_0 [X0] +\n", " b_1 [X1] +\n", " b_2 [X2] +\n", "a_01 [Z0 Z1] +\n", "a_12 [Z1 Z2]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from mindquantum.core.operators import TimeEvolution, QubitOperator\n", "\n", "ham = sum([\n", " QubitOperator('X0', 'b_0'),\n", " QubitOperator('X1', 'b_1'),\n", " QubitOperator('X2', 'b_2'),\n", " QubitOperator('Z0 Z1', 'a_01'),\n", " QubitOperator('Z1 Z2', 'a_12')\n", "])\n", "ham" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "q0: q1: q2: RX 2*b_0 RX 2*b_1 RX 2*b_2 RZ 2*a_01 RZ 2*a_12 " ], "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "circ = TimeEvolution(ham).circuit\n", "circ.barrier()\n", "circ.measure_all()\n", "circ.svg()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here is the processed quantum circuit after being processed by the `noise_adder` defined above:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "q0: q1: q2: RX 2*b_0 RX 2*b_1 RX 2*b_2 DC p=1/50 DC p=1/100 RZ 2*a_01 DC p=1/50 DC p=1/100 DC p=0.03 DC p=1/50 RZ 2*a_12 DC p=0.03 DC p=1/50 BFC p=1/100 BFC p=1/100 BFC p=1/100 " ], "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "noise_adder(circ).svg()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html) list\n", "\n", "Here are some of the existing [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html) in MindQuantum and their specific meanings:\n", "\n", "|[ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html)| Function|\n", "|--|--|\n", "|[ChannelAdderBase](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html)|Add channels before or after quantum gates|\n", "|[NoiseChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.NoiseChannelAdder.html)|Add a single-bit quantum channel|\n", "|[MeasureAccepter](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.MeasureAccepter.html)|Select measurement gates|\n", "|[ReverseAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ReverseAdder.html)|Flip the accept and reject rules of the given channel adder|\n", "|[NoiseExcluder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.NoiseExcluder.html)|Exclude noise gates|\n", "|[BitFlipAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.BitFlipAdder.html)|Add a bit flip channel before or after the quantum gate|\n", "|[MixerAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.MixerAdder.html)|Execute all adders in sequence when the accept and reject sets of the sub-adders are met|\n", "|[SequentialAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.SequentialAdder.html)|Execute each adder in sequence|\n", "|[QubitNumberConstrain](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.QubitNumberConstrain.html)|Only apply noise channels to quantum gates with ``n_qubits`` bits|\n", "|[QubitIDConstrain](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.QubitIDConstrain.html)|Only apply noise channels to quantum gates with the given bit number|\n", "|[GateSelector](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.GateSelector.html)|Select gate to add noise channel|\n", "|[DepolarizingChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.DepolarizingChannelAdder.html)|Add DepolarizingChannel|\n", "\n", "For API documentation of [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html) in MindQuantum, please refer to: [channel_adder](https://www.mindspore.cn/mindquantum/docs/en/master/core/mindquantum.core.circuit.html#channel-adder)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Noise Simulator Based on [ChannelAdder](https://www.mindspore.cn/mindquantum/docs/en/master/core/circuit/mindquantum.core.circuit.ChannelAdderBase.html)\n", "\n", "We can combine the various `Adder` defined above with existing simulators to create a noisy simulator." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "q0: q1: H RX 1 Z " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": [ "Shots:\n", " 10000 Keys: q1 0.0 0.153 0.307 0.46 0.614 0.767 0 7672 1 2328 probability " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from mindquantum.simulator import Simulator\n", "from mindquantum.simulator.noise import NoiseBackend\n", "\n", "noiseless_sim = Simulator('mqvector', 2)\n", "noiseless_circ = Circuit().h(0).rx(1.0, 1).z(1, 0).measure(1)\n", "display_svg(noiseless_circ.svg())\n", "res1 = noiseless_sim.sampling(noiseless_circ, shots=10000)\n", "display(res1.svg())" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "Shots:\n", " 10000 Keys: q1 0.0 0.148 0.295 0.443 0.59 0.738 0 7381 1 2619 probability " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": [ "q0: q1: H RX 1 DC p=1/20 Z DC p=1/20 BFC p=1/100 " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "noise_sim = Simulator(NoiseBackend('mqvector', 2, seq_adder))\n", "res2 = noise_sim.sampling(noiseless_circ, shots=10000)\n", "display(res2.svg())\n", "display(noise_sim.backend.transform_circ(noiseless_circ).svg())" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", " \n", " \n", "\n", "\n", "
SoftwareVersion
mindquantum0.9.11
scipy1.10.1
numpy1.24.4
SystemInfo
Python3.8.17
OSLinux x86_64
Memory16.62 GB
CPU Max Thread16
DateTue Jan 2 15:05:28 2024
\n" ], "text/plain": [ "" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from mindquantum.utils.show_info import InfoTable\n", "\n", "InfoTable('mindquantum', 'scipy', 'numpy')" ] } ], "metadata": { "kernelspec": { "display_name": "MindSpore", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.17" } }, "nbformat": 4, "nbformat_minor": 2 }