Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions documentation/source/general/tutorial/CD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"\n",
"A QUBO probelem is a combinatorical optimization problem that can be formulated as\n",
"\n",
"$$ \\mathrm{min} \\ y = x^T Q x, $$\n",
"$$ \\min_x\\left(x^T Q x\\right), $$\n",
"\n",
"where $Q$ is a symmetric matrix and $x$ are binary vectors $x_i \\in \\{0, 1\\}$.\n",
"\n",
Expand Down Expand Up @@ -370,7 +370,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "ca0fce92",
"metadata": {},
"outputs": [
Expand All @@ -384,6 +384,7 @@
],
"source": [
"from qrisp.algorithms.cold import solve_QUBO\n",
"import numpy as np\n",
"\n",
"Q = np.array([[-1.1, 0.6, 0.4, 0.0, 0.0, 0.0],\n",
" [0.6, -0.9, 0.5, 0.0, 0.0, 0.0],\n",
Expand Down Expand Up @@ -464,7 +465,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "qrisp_08",
"display_name": ".venv (3.11.16.final.0)",
"language": "python",
"name": "python3"
},
Expand All @@ -478,7 +479,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.11"
"version": "3.11.16"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions documentation/source/general/tutorial/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"id": "0791ce5a",
"metadata": {},
"outputs": [
Expand All @@ -529,7 +529,7 @@
],
"source": [
"from math import pi\n",
"from qrisp.grover import diffuser\n",
"from qrisp.algorithms.grover import diffuser\n",
"\n",
"qf = QuantumFloat(3, -1, signed=True)\n",
"\n",
Expand Down
10 changes: 5 additions & 5 deletions src/qrisp/algorithms/cold/dcqo_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def run( # noqa: PLR0913, PLR0917 -- public, keyword-callable API shape
CRAB=False,
optimizer="COBYQA",
objective="agp_coeff_magnitude",
bounds=(),
bounds=(-2, 2),
options={},
mes_kwargs={},
precision=0.01,
Expand All @@ -632,9 +632,9 @@ def run( # noqa: PLR0913, PLR0917 -- public, keyword-callable API shape
Evolution time for the simulation.
method : str
Method to solve the QUBO with. Either ``LCD`` or ``COLD``.
N_opt : int
N_opt : int, optional
Number of optimization parameters in ``H_control``.
CRAB : bool
CRAB : bool, optional
If ``True``, the CRAB optimization method is being used. The default is ``False``.
optimizer : str, optional
Specifies the `SciPy optimization routine
Expand All @@ -647,8 +647,8 @@ def run( # noqa: PLR0913, PLR0917 -- public, keyword-callable API shape
``agp_coeff_magnitude``.
bounds : tuple
The parameter bounds for the optimizer. Default is (-2, 2).
options : dict
Additional options for the Scipy solver.
options : dict, optional
A dictionary of additional options for the Scipy solver.
mes_kwargs : dict, optional
The keyword arguments for the measurement function. Default is an empty dictionary.
precision : float, optional
Expand Down
9 changes: 5 additions & 4 deletions src/qrisp/core/quantum_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def clear_data(self):
self.data.clear()

def statevector(self, return_type="sympy", plot=False, decimals=None):
r"""Returns a representation of the statevector. Three options are available:
r"""Returns a representation of the statevector. Four options are available:

* ``sympy`` returns a `Sympy quantum state
<https://docs.sympy.org/latest/modules/physics/quantum/state.html>`_,
Expand All @@ -551,15 +551,16 @@ def statevector(self, return_type="sympy", plot=False, decimals=None):
investigated by calling this function on a dictionary of this QuantumSession's
QuantumVariables.

If you need to retrieve the statevector as a numpy array, please use the
corresponding
* ``array`` returns an array, just like the corresponding
:meth:`QuantumCircuit method <qrisp.QuantumCircuit.statevector_array>`.
If you don't need the options ``plot`` and ``decimals`` then please use
that function instead.

Parameters
----------
return_type : str, optional
String indicating how the statevector should be returned. Available are
``sympy``, ``array`` and ``function``. The default is ``sympy``.
``sympy``, ``latex``, ``function`` and ``array``. The default is ``sympy``.
plot : bool, optional
If the return type is set to ``array``, this boolean will trigger a plot of
the statevector. The default is ``False``.
Expand Down
2 changes: 1 addition & 1 deletion src/qrisp/environments/quantum_conditionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def quantum_eq(qv_0, qv_1):
state $\ket{0}$. After this, we apply regular X gates onto ``temp_qv`` such that
the qubits where the inputs agree, are in state $\ket{1}$. Finally,
we apply a multi-controlled X gate onto the result to flip the result, if
all of qubits of the qubits in ``temp_qv`` are in the $\ket{0}$ state.
all of qubits of the qubits in ``temp_qv`` are in the $\ket{1}$ state.

We inspect the resulting QuantumCircuit

Expand Down