From 790cedf40e53bd1b861b368c4333ddd4f3045d1b Mon Sep 17 00:00:00 2001 From: Adrian Mak Date: Tue, 3 Oct 2023 14:40:18 +0800 Subject: [PATCH] update getting-started docs --- doc/source/getting-started/ansatz.rst | 24 +++++++++++++++++++-- doc/source/getting-started/index.rst | 2 ++ doc/source/getting-started/installation.rst | 1 + doc/source/getting-started/measurement.rst | 2 ++ doc/source/getting-started/molecule.rst | 1 + 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/doc/source/getting-started/ansatz.rst b/doc/source/getting-started/ansatz.rst index 6310e0b..db256c8 100644 --- a/doc/source/getting-started/ansatz.rst +++ b/doc/source/getting-started/ansatz.rst @@ -7,14 +7,34 @@ A quantum circuit consisting of parameterized gates RX(theta), RY(theta) and RZ( Hardware Efficient Ansatz ------------------------- -Qibochem provides a hardware efficient ansatz that simply consists of a layer of single qubit rotation gates followed by a layer of two-qubit gates that entangle the qubits. For the H\ :sub:`2` case discussed in previous sections, a possible hardware efficient ansatz can be constructed as such: +Qibochem provides a hardware efficient ansatz that simply consists of a layer of single-qubit rotation gates followed by a layer of two-qubit gates that entangle the qubits. For the H\ :sub:`2` case discussed in previous sections, a possible hardware efficient ansatz can be constructed as such: .. image:: qibochem_doc_ansatz_hardware-efficient.svg Example ^^^^^^^ -Placeholder for hardware-efficient ansatz example +.. code-block:: python + + from qibochem.ansatz import hardware_efficient + import qibo + + nlayers = 1 + nqubits = 4 + nfermions = 2 + + circuit = qibo.models.Circuit(4) + circuit.add(gates.X(_i) for _i in range(nfermions)) + hardware_efficient_ansatz = hardware_efficient.hea(nlayers, nqubits) + circuit.add(hardware_efficient_ansatz) + print(circuit.draw()) + +.. code-block:: output + + q0: ─X──RY─RZ─o─────Z─ + q1: ─X──RY─RZ─Z─o───|─ + q2: ─RY─RZ──────Z─o─|─ + q3: ─RY─RZ────────Z─o─ Unitary Coupled Cluster Ansatz diff --git a/doc/source/getting-started/index.rst b/doc/source/getting-started/index.rst index b9d719b..13dfb4b 100644 --- a/doc/source/getting-started/index.rst +++ b/doc/source/getting-started/index.rst @@ -1,3 +1,4 @@ +=============== Getting started =============== @@ -11,4 +12,5 @@ This section covers the basics of qibochem. More details are given in the follow molecule hamiltonian ansatz +.. measurement diff --git a/doc/source/getting-started/installation.rst b/doc/source/getting-started/installation.rst index 50bb6f2..6ecf9fb 100644 --- a/doc/source/getting-started/installation.rst +++ b/doc/source/getting-started/installation.rst @@ -1,3 +1,4 @@ +============ Installation ============ diff --git a/doc/source/getting-started/measurement.rst b/doc/source/getting-started/measurement.rst index 7123879..d04f1ed 100644 --- a/doc/source/getting-started/measurement.rst +++ b/doc/source/getting-started/measurement.rst @@ -1,2 +1,4 @@ +=========== Measurement =========== + diff --git a/doc/source/getting-started/molecule.rst b/doc/source/getting-started/molecule.rst index 520fe6b..92ca7cc 100644 --- a/doc/source/getting-started/molecule.rst +++ b/doc/source/getting-started/molecule.rst @@ -1,3 +1,4 @@ +======== Molecule ========