Skip to content

Commit

Permalink
Merge branch 'master' into entanglement
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroSopena committed Oct 2, 2024
2 parents 3619539 + fee545b commit 165b204
Show file tree
Hide file tree
Showing 67 changed files with 2,140 additions and 1,189 deletions.
24 changes: 24 additions & 0 deletions doc/source/api-reference/qibo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,12 @@ Classical relative entropy
.. autofunction:: qibo.quantum_info.classical_relative_entropy


Classical mutual information
""""""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.classical_mutual_information


Classical Rényi entropy
"""""""""""""""""""""""

Expand Down Expand Up @@ -1785,6 +1791,12 @@ Relative von Neumann entropy
an error will be raised when using `cupy` backend.


Mutual information
""""""""""""""""""

.. autofunction:: qibo.quantum_info.mutual_information


Rényi entropy
"""""""""""""

Expand Down Expand Up @@ -1952,6 +1964,12 @@ Matrix exponentiation
.. autofunction:: qibo.quantum_info.matrix_exponentiation


Matrix power
""""""""""""

.. autofunction:: qibo.quantum_info.matrix_power


Quantum Networks
^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -2386,6 +2404,12 @@ Hellinger shot error
.. autofunction:: qibo.quantum_info.hellinger_shot_error


Total variation distance
""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.total_variation_distance


Haar integral
"""""""""""""

Expand Down
6 changes: 3 additions & 3 deletions doc/source/code-examples/advancedexamples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ Additionally, one can also pass single-qubit readout error probabilities (`reado
)

print("raw circuit:")
print(circuit.draw())
circuit.draw()

parameters = {
"t1": {"0": 250*1e-06, "1": 240*1e-06},
Expand All @@ -1168,7 +1168,7 @@ Additionally, one can also pass single-qubit readout error probabilities (`reado
noisy_circuit = noise_model.apply(circuit)

print("noisy circuit:")
print(noisy_circuit.draw())
noisy_circuit.draw()

.. testoutput::
:hide:
Expand Down Expand Up @@ -1242,7 +1242,7 @@ Let's see how to use them. For starters, let's define a dummy circuit with some
circ.add(gates.M(*range(nqubits)))
# visualize the circuit
print(circ.draw())
circ.draw()

# q0: ─RZ─RX─RZ─RX─RZ─o────o────────M─
# q1: ─RZ─RX─RZ─RX─RZ─X─RZ─X─o────o─M─
Expand Down
2 changes: 1 addition & 1 deletion doc/source/code-examples/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ For example
from qibo.models import QFT

c = QFT(5)
print(c.draw())
c.draw()
# Prints
'''
q0: ─H─U1─U1─U1─U1───────────────────────────x───
Expand Down
41 changes: 0 additions & 41 deletions doc/source/getting-started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ Make sure you have Python 3.9 or greater, then use ``pip`` to install ``qibo`` w
The ``pip`` program will download and install all the required
dependencies for Qibo.

Installing with conda
"""""""""""""""""""""

We provide conda packages for ``qibo`` through the `conda-forge
<https://anaconda.org/conda-forge>`_ channel.

To install the package with conda run:

.. code-block:: bash
conda install -c conda-forge qibo

Installing from source
""""""""""""""""""""""
Expand Down Expand Up @@ -139,35 +127,6 @@ In order to install the package use the following command:
`cuQuantum SDK v22.05 <https://docs.nvidia.com/cuda/cuquantum/cuquantum_sdk_release_notes.html#cuquantum-sdk-v22-05>`__.


Installing with conda
"""""""""""""""""""""

We provide conda packages for ``qibo`` and ``qibojit`` through the `conda-forge
<https://anaconda.org/conda-forge>`_ channel.

To install both packages with conda run:

.. code-block:: bash
conda install -c conda-forge qibojit
.. note::
The ``conda`` program will download and install all the required
dependencies except `cupy <https://cupy.dev/>`_ and/or
`cuQuantum <https://developer.nvidia.com/cuquantum-sdk>`_
which are required for GPU acceleration.
The cuQuantum dependency is optional, as it is required only for
the ``cuquantum`` platform. Please install `cupy <https://cupy.dev/>`_ by following the
instructions from the `official website
<https://docs.cupy.dev/en/stable/install.html>`_ for your GPU hardware.
The installation instructions for `cuQuantum <https://developer.nvidia.com/cuquantum-sdk>`_
are available in the `official documentation <https://docs.nvidia.com/cuda/cuquantum/python/README.html>`__.
``qibojit`` is compatible with
`cuQuantum SDK v22.03 <https://docs.nvidia.com/cuda/cuquantum/cuquantum_sdk_release_notes.html#cuquantum-sdk-v22-03>`__
and
`cuQuantum SDK v22.05 <https://docs.nvidia.com/cuda/cuquantum/cuquantum_sdk_release_notes.html#cuquantum-sdk-v22-05>`__.


Installing from source
""""""""""""""""""""""

Expand Down
2 changes: 1 addition & 1 deletion examples/adiabatic_qml/adiabatic-qml.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@
"circ1 = rotcirc.rotations_circuit(t=0.1)\n",
"circ2 = rotcirc.rotations_circuit(t=0.8)\n",
"\n",
"print(f\"Circuit diagram: {circ1.draw()}\")\n",
"print(f\"Circuit diagram: {str(circ1)}\")\n",
"print(f\"\\nCirc1 params: {circ1.get_parameters()}\")\n",
"print(f\"\\nCirc2 params: {circ2.get_parameters()}\")"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/anomaly_detection/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def compute_loss_test(encoder, vector):
encoder_test = make_encoder(n_qubits, n_layers, trained_params, q_compression)
encoder_test.compile()
print("Circuit model summary")
print(encoder_test.draw())
encoder_test.draw()

print("Computing losses...")
# Compute loss for standard data
Expand Down
2 changes: 1 addition & 1 deletion examples/anomaly_detection/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def train_step(batch_size, encoder, params, dataset):
# Create and print encoder circuit
encoder = make_encoder(n_qubits, n_layers, params, q_compression)
print("Circuit model summary")
print(encoder.draw())
encoder.draw()

# Define optimizer parameters
steps_for_epoch = math.ceil(train_size / batch_size)
Expand Down
14 changes: 7 additions & 7 deletions examples/circuit-draw-mpl/qibo-draw-circuit-matplotlib.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
" \n",
"ansatz.add((gates.RY(q, theta=0) for q in range(nqubits)))\n",
"ansatz.add(gates.M(qubit) for qubit in range(2))\n",
"print(ansatz.draw())"
"ansatz.draw()"
]
},
{
Expand Down Expand Up @@ -185,7 +185,7 @@
"c.add(gates.X(1))\n",
"c.add(gates.X(0))\n",
"c.add(gates.M(qubit) for qubit in range(2))\n",
"print(c.draw())"
"c.draw()"
]
},
{
Expand All @@ -206,7 +206,7 @@
}
],
"source": [
"plot_circuit(c);"
"plot_circuit(c)"
]
},
{
Expand All @@ -231,7 +231,7 @@
"c = QFT(5)\n",
"c.add(gates.M(qubit) for qubit in range(2))\n",
"\n",
"print(c.draw())"
"c.draw()"
]
},
{
Expand Down Expand Up @@ -265,7 +265,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 17,
"id": "916f7b83-1ad7-4984-8573-eb55dfeb125d",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -384,7 +384,7 @@
}
],
"source": [
"print(c.fuse().draw())"
"c.fuse().draw()"
]
},
{
Expand Down Expand Up @@ -440,7 +440,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fa46e167",
"id": "626f9d58",
"metadata": {},
"outputs": [],
"source": []
Expand Down
Loading

0 comments on commit 165b204

Please sign in to comment.