From e2991dd791e51546428f979057806d65623c9180 Mon Sep 17 00:00:00 2001 From: Brian Doolittle Date: Sat, 3 Aug 2024 10:59:25 -0400 Subject: [PATCH] minor docs tweaks --- docs/source/cost/index.rst | 1 + docs/source/cost/negativity.rst | 6 ++++++ docs/source/cost/qnodes.rst | 5 +++++ docs/source/utilities.rst | 6 ++++++ src/qnetvo/cost/negativity.py | 2 +- src/qnetvo/utilities.py | 6 +++--- 6 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 docs/source/cost/negativity.rst diff --git a/docs/source/cost/index.rst b/docs/source/cost/index.rst index 148bc25..f38d621 100644 --- a/docs/source/cost/index.rst +++ b/docs/source/cost/index.rst @@ -19,4 +19,5 @@ Custom cost functions can be implemented using PennyLane. linear_inequalities entropic_quantities magic_squares_game + negativity nonlocality_witnesses/index diff --git a/docs/source/cost/negativity.rst b/docs/source/cost/negativity.rst new file mode 100644 index 0000000..edd4199 --- /dev/null +++ b/docs/source/cost/negativity.rst @@ -0,0 +1,6 @@ +Partial Transpose Negativity +============================ + +.. currentmodule:: qnetvo + +.. autofunction:: negativity_cost_fn diff --git a/docs/source/cost/qnodes.rst b/docs/source/cost/qnodes.rst index df04276..ee8518e 100644 --- a/docs/source/cost/qnodes.rst +++ b/docs/source/cost/qnodes.rst @@ -14,6 +14,11 @@ Probability QNodes .. autofunction:: joint_probs_qnode +Density Matrix QNodes +--------------------- + +.. autofunction:: density_matrix_qnode + Parity Observable QNodes ------------------------ diff --git a/docs/source/utilities.rst b/docs/source/utilities.rst index a1f26b5..1818157 100644 --- a/docs/source/utilities.rst +++ b/docs/source/utilities.rst @@ -3,6 +3,12 @@ Utilities .. currentmodule:: qnetvo + +Mathematical Operations +----------------------- + +.. autofunction:: partial_transpose + Circuit Tomography ------------------ diff --git a/src/qnetvo/cost/negativity.py b/src/qnetvo/cost/negativity.py index f18df3a..9186b16 100644 --- a/src/qnetvo/cost/negativity.py +++ b/src/qnetvo/cost/negativity.py @@ -21,7 +21,7 @@ def negativity_cost_fn(network_ansatz, m, n, wires, qnode_kwargs={}): the :math:`B` party, and :math:`\\lambda_i` are all of the eigenvalues of :math:`\\rho^{\\Gamma_B}`. For more information on negativity and its applications in quantum information theory, - see [Vidal and Werner (2001)](https://arxiv.org/pdf/quant-ph/0102117). + (see `Vidal and Werner, 2001 `_). :param ansatz: The ansatz circuit on which the negativity is evaluated. :type ansatz: NetworkAnsatz diff --git a/src/qnetvo/utilities.py b/src/qnetvo/utilities.py index ef6e83f..e1a434a 100644 --- a/src/qnetvo/utilities.py +++ b/src/qnetvo/utilities.py @@ -196,16 +196,16 @@ def partial_transpose(dm, d1, d2): :param dm: The density matrix to be partially transposed. :type dm: np.array - :param d1: The dimension of the first subsystem (e.g., 2^m where m is the number of qubits in the first subsystem). + :param d1: The dimension of the first subsystem (e.g., :math:`2^m` where :math:`m` is the number of qubits in the first subsystem). :type d1: int - :param d2: The dimension of the second subsystem (e.g., 2^n where n is the number of qubits in the second subsystem). + :param d2: The dimension of the second subsystem (e.g., :math:`2^n` where :math:`n` is the number of qubits in the second subsystem). :type d2: int :returns: The partially transposed density matrix. :rtype: np.array - :raises ValueError: If the product of `d1` and `d2` does not match the size of the density matrix. + :raises ValueError: If the product of ``d1`` and ``d2`` does not match the size of the density matrix. """ if d1 * d2 != dm.shape[0]: