diff --git a/doc/source/code-examples/index.rst b/doc/source/code-examples/index.rst index a58dde3..31f738f 100644 --- a/doc/source/code-examples/index.rst +++ b/doc/source/code-examples/index.rst @@ -3,4 +3,3 @@ Code examples ============= This section provides tutorials for using qibochem. - diff --git a/doc/source/conf.py b/doc/source/conf.py index 2a13f04..55f5541 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -134,4 +134,5 @@ def setup(app): app.add_transform(AutoStructify) app.add_css_file("css/style.css") + html_show_sourcelink = False diff --git a/doc/source/getting-started/ansatz.rst b/doc/source/getting-started/ansatz.rst index 9ba6838..1a2ee96 100644 --- a/doc/source/getting-started/ansatz.rst +++ b/doc/source/getting-started/ansatz.rst @@ -38,10 +38,10 @@ Example The energy of the state generated from the hardware efficient ansatz for the fermionic two-body Hamiltonian can then be estimated, using statevectors or samples. The following example calculates the energy of the H2 molecule. -Example +Example ^^^^^^^ -.. code-block:: python +.. code-block:: python from qibochem.driver.molecule import Molecule from qibochem.measurement.expectation import expectation @@ -56,7 +56,7 @@ Example nlayers = 1 nqubits = mol.nso ntheta = 2 * nqubits * nlayers - + hea_ansatz = hardware_efficient.hea(nlayers, nqubits) circuit = models.Circuit(nqubits) circuit.add(gates.X(_i) for _i in range(sum(mol.nelec))) @@ -76,11 +76,11 @@ Example converged SCF energy = -1.11628373627429 classical HF/STO-3G energy for H2 at 0.74804 Angstroms: -1.1162837362742921 - quantum hardware-efficient circuit expectation value for thetas: + quantum hardware-efficient circuit expectation value for thetas: theta energy - -0.2 : -1.091694412147 - 0.0 : -1.116283736274 - 0.2 : -1.091694412147 + -0.2 : -1.091694412147 + 0.0 : -1.116283736274 + 0.2 : -1.091694412147 Unitary Coupled Cluster Ansatz ------------------------------ diff --git a/doc/source/getting-started/measurement.rst b/doc/source/getting-started/measurement.rst index 6e02f00..8324ec8 100644 --- a/doc/source/getting-started/measurement.rst +++ b/doc/source/getting-started/measurement.rst @@ -32,13 +32,13 @@ Example circuit.add(gates.RZ(0, theta=0.0)) circuit.add(gates.CNOT(1, 0)) circuit.add(gates.RX(0, np.pi/2, trainable=False)) - circuit.add(gates.RY(1, -np.pi/2, trainable=False)) + circuit.add(gates.RY(1, -np.pi/2, trainable=False)) print(circuit.draw()) def energy_expectation_samples(parameters, circuit, hamiltonian, nshots=1024): return expectation(circuit, hamiltonian, from_samples=True, n_shots=nshots) - + parameters = [0.5] nshots = 8192 vqe_uccsd = minimize(energy_expectation_samples, parameters, args=(circuit, bk_ham, nshots), method='Powell')