From 702e60063e5f3f6d767c26f7030b2d20bd014fa3 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Mon, 8 Aug 2022 13:37:09 -0400 Subject: [PATCH 01/35] Code completed, but wrong eigenvalues. --- .../toolboxes/qubit_mappings/combinatorial.py | 276 ++++++++++++++++++ 1 file changed, 276 insertions(+) create mode 100644 tangelo/toolboxes/qubit_mappings/combinatorial.py diff --git a/tangelo/toolboxes/qubit_mappings/combinatorial.py b/tangelo/toolboxes/qubit_mappings/combinatorial.py new file mode 100644 index 000000000..ef6394e0d --- /dev/null +++ b/tangelo/toolboxes/qubit_mappings/combinatorial.py @@ -0,0 +1,276 @@ +# Copyright 2021 Good Chemistry Company. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""TODO +""" + +import itertools +from collections import OrderedDict +from math import ceil + +from openfermion import chemist_ordered +from openfermion.linalg import qubit_operator_sparse, get_sparse_operator +import numpy as np +from scipy.special import comb + +from tangelo.linq.helpers.circuits.measurement_basis import pauli_string_to_of +from tangelo.toolboxes.operators import QubitOperator, FermionOperator + + +def f(sigma, M): + """TODO + + Args: + + Returns: + + """ + N = len(sigma) + + terms_k = [comb(M-sigma[N-1-k]-1, k+1) for k in range(N)] + unique_int = comb(M, N) - 1 - np.sum(terms_k) + + if not unique_int.is_integer(): + raise ValueError + return int(unique_int) + +def basis(M, N): + """TODO + + Args: + + Returns: + + """ + mapping = [(sigma, f(sigma, M)) for sigma in itertools.combinations(range(M), N)] + return OrderedDict(mapping) + +def get_bitstring(sigma, M): + """TODO + + Args: + + Returns: + + """ + + bitstring = np.zeros(M) + np.put(bitstring, ind=sigma, v=1) + + return bitstring + +def get_sigmam(bistring): + """TODO + + Args: + + Returns: + + """ + + sigma = tuple(np.where(bistring == 1)[0]) + M = len(bistring) + + return sigma, M + +def op_on_sigma(ops, sigma): + """ Eq. (20) without the (-1)^p term.""" + + assert len(ops) == 2, f"{ops}" + + sigma = list(sigma) + + for i_qubit, creation_op in reversed(ops): + # If it is a^{\dagger} (creation operator) + if creation_op: + if i_qubit not in sigma: + + sigma = [*sigma, i_qubit] + else: + return 0 + else: + if i_qubit in sigma: + sigma.remove(i_qubit) + else: + return 0 + + return tuple(sorted(sigma)) + + +def compact_hamiltonian(H_ferm, n_modes, n_electrons, h1, h2): + """TODO + up_then_down must be set to False for now. + + Args: + + Returns: + + """ + + #assert H_ferm.is_normal_ordered() + #H_ferm = chemist_ordered(H_ferm) + #print(H_ferm.constant) + + if isinstance(n_electrons, tuple) and len(n_electrons) == 2: + n_alpha, n_beta = n_electrons + elif isinstance(n_electrons, int) and n_electrons % 2 == 0: + n_alpha = n_beta = n_electrons // 2 + else: + raise ValueError + + n_choose_alpha = comb(n_modes, n_alpha, exact=True) + n = ceil(np.log2(n_choose_alpha * comb(n_modes, n_beta, exact=True))) + + basis_set_alpha = basis(n_modes, n_alpha) + basis_set_beta = basis(n_modes, n_beta) + basis_set = OrderedDict() + for sigma_alpha, int_alpha in basis_set_alpha.items(): + for sigma_beta, int_beta in basis_set_beta.items(): + sigma = tuple(sorted([2*sa for sa in sigma_alpha] + [2*sb+1 for sb in sigma_beta])) + unique_int = (int_alpha*n_choose_alpha)+int_beta + basis_set[sigma] = unique_int + + #print(basis_set) + + # H_1 and H_2 initialization to 2^n * 2^n matrices. + h_one = np.zeros((2**n, 2**n)) + h_two = np.zeros((2**n, 2**n)) + + """ + for op, _ in H_ferm.terms.items(): + for sigma_pp, unique_int in basis_set.items(): + + # 1-body terms. + if len(op) == 2: + i, j = op[0][0], op[1][0] + + sigma_qq = op_on_sigma(op, sigma_pp) + + if sigma_qq in basis_set.keys(): + int_p = basis_set[sigma_pp] + int_q = basis_set[sigma_qq] + + h_one[int_p, int_q] += h1[i][j] + h_one[int_q, int_p] += h1[j][i].conj() + + # 2-body terms. + elif len(op) == 4: + i, j, k, l = op[0][0], op[1][0], op[2][0], op[3][0] + + sigma_qq = op_on_sigma(op[:2], sigma_pp) + + if sigma_qq in basis_set.keys(): + sigma_tt = op_on_sigma(op[2:], sigma_qq) + + if sigma_tt in basis_set.keys(): + int_p = basis_set[sigma_pp] + int_t = basis_set[sigma_tt] + + h_two[int_p, int_t] += h2[i][j][k][l] + h_two[int_t, int_p] += h2[k][l][i][j].conj() + + j, k = op[1][0], op[2][0] + if j == k: + raise ValueError + """ + + for sigma_pp, unique_int in basis_set.items(): + + # 1-body terms. + for i, j in itertools.product(range(2*n_modes), repeat=2): + op = ((i, 1), (j, 0)) + sigma_qq = op_on_sigma(op, sigma_pp) + + if sigma_qq in basis_set.keys(): + int_p = basis_set[sigma_pp] + int_q = basis_set[sigma_qq] + + h_one[int_p, int_q] += h1[i][j] + h_one[int_q, int_p] += h1[j][i].conj() + + #for sigma_pp, unique_int in basis_set.items(): + # 2-body terms. + for i, j, k, l in itertools.product(range(2*n_modes), repeat=4): + op = ((i, 1), (j, 0), (k, 1), (l, 0)) + sigma_qq = op_on_sigma(op[:2], sigma_pp) + + if sigma_qq in basis_set.keys(): + sigma_tt = op_on_sigma(op[2:], sigma_qq) + + if sigma_tt in basis_set.keys(): + int_p = basis_set[sigma_pp] + int_t = basis_set[sigma_tt] + + h_two[int_p, int_t] += h2[i][j][k][l] + h_two[int_t, int_p] += h2[k][l][i][j].conj() + + if k == j: + op_il = (op[0], op[-1]) + sigma_qq = op_on_sigma(op_il, sigma_pp) + + if sigma_qq in basis_set.keys(): + int_q = basis_set[sigma_qq] + int_p = basis_set[sigma_pp] + + h_two[int_p, int_q] -= h2[i][j][k][l] + h_two[int_q, int_p] -= h2[k][l][i][j].conj() + + # Return the compact Hamiltonian H_c + return h_one + h_two # + H_ferm.constant + +def h_to_qubitop(h_c, n): + + qu_op = QubitOperator() + + for pauli_tensor in itertools.product("IXYZ", repeat=n): + pauli_word = "".join(pauli_tensor) + term = pauli_string_to_of(pauli_word) + + term_op = QubitOperator(term, 1.) + + c_j = np.trace(h_c.conj().T @ qubit_operator_sparse(term_op, n_qubits=n).todense()) + qu_op += QubitOperator(term, c_j) + + qu_op *= 1 / np.sqrt(2**n) * 0.5 # Why the 0.5 factor!!! + qu_op.compress() + return qu_op + + +if __name__ == "__main__": + + from openfermion.linalg import eigenspectrum + from openfermion.chem.molecular_data import spinorb_from_spatial + from tangelo.molecule_library import mol_H2_sto3g, mol_H4_sto3g + mol = mol_H2_sto3g + + H_ferm = chemist_ordered(mol.fermionic_hamiltonian) + true_eigs = eigenspectrum(H_ferm) + print(true_eigs) + + core_constant, one_body_integrals, two_body_integrals = mol.get_active_space_integrals() + one_body_coefficients, two_body_coefficients = spinorb_from_spatial(one_body_integrals, two_body_integrals) + + H = compact_hamiltonian(H_ferm, mol.n_active_mos, mol.n_active_electrons, one_body_coefficients, two_body_coefficients) + #norm_factor = np.trace(H.conj().T @ H) + #H /= np.sqrt(norm_factor) + #H *= 2 + eigs, eigvs = np.linalg.eigh(H) + print(eigs) + #print(eigvs) + + #Hq = h_to_qubitop(H, 2) + #print(Hq) + #matrix = qubit_operator_sparse(Hq).todense() + #eigs, eigvs = np.linalg.eigh(matrix) + #print(eigs) From 69a9a2fb6ddb2fb7ccff9be5fc1567e85dddedca Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Tue, 9 Aug 2022 09:55:55 -0400 Subject: [PATCH 02/35] WIP. --- .../toolboxes/qubit_mappings/combinatorial.py | 95 +++++++------------ 1 file changed, 35 insertions(+), 60 deletions(-) diff --git a/tangelo/toolboxes/qubit_mappings/combinatorial.py b/tangelo/toolboxes/qubit_mappings/combinatorial.py index ef6394e0d..9f96a8323 100644 --- a/tangelo/toolboxes/qubit_mappings/combinatorial.py +++ b/tangelo/toolboxes/qubit_mappings/combinatorial.py @@ -18,6 +18,7 @@ import itertools from collections import OrderedDict from math import ceil +from copy import deepcopy from openfermion import chemist_ordered from openfermion.linalg import qubit_operator_sparse, get_sparse_operator @@ -84,28 +85,35 @@ def get_sigmam(bistring): return sigma, M -def op_on_sigma(ops, sigma): +def op_on_sigma(ops, sigma_in): """ Eq. (20) without the (-1)^p term.""" assert len(ops) == 2, f"{ops}" + sigma = deepcopy(sigma_in) sigma = list(sigma) for i_qubit, creation_op in reversed(ops): # If it is a^{\dagger} (creation operator) if creation_op: if i_qubit not in sigma: - sigma = [*sigma, i_qubit] + i = i_qubit else: - return 0 + return 0, 0 else: if i_qubit in sigma: sigma.remove(i_qubit) + j = i_qubit else: - return 0 + return 0, 0 + + if i in sigma_in: + p = i + elif j in sigma_in: + p = j - return tuple(sorted(sigma)) + return tuple(sorted(sigma)), (-1)**p def compact_hamiltonian(H_ferm, n_modes, n_electrons, h1, h2): @@ -137,94 +145,57 @@ def compact_hamiltonian(H_ferm, n_modes, n_electrons, h1, h2): basis_set = OrderedDict() for sigma_alpha, int_alpha in basis_set_alpha.items(): for sigma_beta, int_beta in basis_set_beta.items(): + # Alternate ordering (like FermionOperator) sigma = tuple(sorted([2*sa for sa in sigma_alpha] + [2*sb+1 for sb in sigma_beta])) - unique_int = (int_alpha*n_choose_alpha)+int_beta + unique_int = (int_alpha * n_choose_alpha) + int_beta basis_set[sigma] = unique_int - #print(basis_set) + print(basis_set) # H_1 and H_2 initialization to 2^n * 2^n matrices. h_one = np.zeros((2**n, 2**n)) h_two = np.zeros((2**n, 2**n)) - """ - for op, _ in H_ferm.terms.items(): - for sigma_pp, unique_int in basis_set.items(): - - # 1-body terms. - if len(op) == 2: - i, j = op[0][0], op[1][0] - - sigma_qq = op_on_sigma(op, sigma_pp) - - if sigma_qq in basis_set.keys(): - int_p = basis_set[sigma_pp] - int_q = basis_set[sigma_qq] - - h_one[int_p, int_q] += h1[i][j] - h_one[int_q, int_p] += h1[j][i].conj() - - # 2-body terms. - elif len(op) == 4: - i, j, k, l = op[0][0], op[1][0], op[2][0], op[3][0] - - sigma_qq = op_on_sigma(op[:2], sigma_pp) - - if sigma_qq in basis_set.keys(): - sigma_tt = op_on_sigma(op[2:], sigma_qq) - - if sigma_tt in basis_set.keys(): - int_p = basis_set[sigma_pp] - int_t = basis_set[sigma_tt] - - h_two[int_p, int_t] += h2[i][j][k][l] - h_two[int_t, int_p] += h2[k][l][i][j].conj() - - j, k = op[1][0], op[2][0] - if j == k: - raise ValueError - """ - for sigma_pp, unique_int in basis_set.items(): # 1-body terms. for i, j in itertools.product(range(2*n_modes), repeat=2): op = ((i, 1), (j, 0)) - sigma_qq = op_on_sigma(op, sigma_pp) + sigma_qq, phase_qq = op_on_sigma(op, sigma_pp) if sigma_qq in basis_set.keys(): int_p = basis_set[sigma_pp] int_q = basis_set[sigma_qq] - h_one[int_p, int_q] += h1[i][j] - h_one[int_q, int_p] += h1[j][i].conj() + h_one[int_p][int_q] += h1[i][j]# * phase_qq + h_one[int_q][int_p] += h1[j][i].conj()# * phase_qq #for sigma_pp, unique_int in basis_set.items(): # 2-body terms. for i, j, k, l in itertools.product(range(2*n_modes), repeat=4): op = ((i, 1), (j, 0), (k, 1), (l, 0)) - sigma_qq = op_on_sigma(op[:2], sigma_pp) + sigma_qq, phase_qq = op_on_sigma(op[:2], sigma_pp) if sigma_qq in basis_set.keys(): - sigma_tt = op_on_sigma(op[2:], sigma_qq) + sigma_tt, phase_tt = op_on_sigma(op[2:], sigma_qq) if sigma_tt in basis_set.keys(): int_p = basis_set[sigma_pp] int_t = basis_set[sigma_tt] - h_two[int_p, int_t] += h2[i][j][k][l] - h_two[int_t, int_p] += h2[k][l][i][j].conj() + h_two[int_p][int_t] += h2[i][j][k][l]# * phase_tt * phase_qq + h_two[int_t][int_p] += h2[k][l][i][j].conj()# * phase_tt * phase_qq if k == j: - op_il = (op[0], op[-1]) - sigma_qq = op_on_sigma(op_il, sigma_pp) + op_il = (op[0], op[-1]) + sigma_qq, phase_qq = op_on_sigma(op_il, sigma_pp) if sigma_qq in basis_set.keys(): int_q = basis_set[sigma_qq] int_p = basis_set[sigma_pp] - h_two[int_p, int_q] -= h2[i][j][k][l] - h_two[int_q, int_p] -= h2[k][l][i][j].conj() + h_two[int_p][int_q] -= h2[i][j][k][l]# * phase_qq + h_two[int_q][int_p] -= h2[k][l][i][j].conj()# * phase_qq # Return the compact Hamiltonian H_c return h_one + h_two # + H_ferm.constant @@ -254,23 +225,27 @@ def h_to_qubitop(h_c, n): from tangelo.molecule_library import mol_H2_sto3g, mol_H4_sto3g mol = mol_H2_sto3g + H_ferm = mol.fermionic_hamiltonian H_ferm = chemist_ordered(mol.fermionic_hamiltonian) true_eigs = eigenspectrum(H_ferm) print(true_eigs) core_constant, one_body_integrals, two_body_integrals = mol.get_active_space_integrals() one_body_coefficients, two_body_coefficients = spinorb_from_spatial(one_body_integrals, two_body_integrals) + #two_body_coefficients *= 0.5 + + #print(two_body_integrals) + #print(two_body_coefficients) H = compact_hamiltonian(H_ferm, mol.n_active_mos, mol.n_active_electrons, one_body_coefficients, two_body_coefficients) - #norm_factor = np.trace(H.conj().T @ H) - #H /= np.sqrt(norm_factor) - #H *= 2 eigs, eigvs = np.linalg.eigh(H) print(eigs) - #print(eigvs) + #print(H) #Hq = h_to_qubitop(H, 2) #print(Hq) #matrix = qubit_operator_sparse(Hq).todense() #eigs, eigvs = np.linalg.eigh(matrix) #print(eigs) + + #print(op_on_sigma(((3, 1), (3, 0)), (1, 3))) From ef8a1809021400eced06fe69bf9ef3403ea128bd Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Wed, 10 Aug 2022 15:30:30 -0400 Subject: [PATCH 03/35] Mod for Tangelo notebook to be ran on GColab. --- examples/adapt.ipynb | 303 ++++++++-- examples/classical_shadows.ipynb | 49 +- examples/dmet.ipynb | 119 ++-- examples/mifno.ipynb | 152 ++--- examples/oniom.ipynb | 35 +- examples/vqe.ipynb | 576 +++++++++---------- examples/vqe_custom_ansatz_hamiltonian.ipynb | 235 ++++---- 7 files changed, 836 insertions(+), 633 deletions(-) diff --git a/examples/adapt.ipynb b/examples/adapt.ipynb index 6fd927f79..8780a7776 100755 --- a/examples/adapt.ipynb +++ b/examples/adapt.ipynb @@ -14,6 +14,19 @@ "In this notebook, we explore the implementation of this algorithm, available in Tangelo. The original algorithm is examined first, and has shown some success in reducing the number of variational parameters required to express the quantum state. Then, we examine another version of ADAPT-VQE which is successful at reducing the circuit size by using a pool of operators defined from the Qubit Hamiltonian." ] }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install tangelo-gc --quiet" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -41,19 +54,38 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/alex/Codes/Tangelo/tangelo/algorithms/variational/vqe_solver.py:260: RuntimeWarning: No variational gate found in the circuit.\n", + " warnings.warn(\"No variational gate found in the circuit.\", RuntimeWarning)\n" + ] + }, + { + "data": { + "text/plain": [ + "-2.028211284185079" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from tangelo import SecondQuantizedMolecule\n", "from tangelo.algorithms import ADAPTSolver\n", "\n", "H4 = [(\"H\", (0, 0, 0)), (\"H\", (0, 1.4, 0)), (\"H\", (0, 2.8, 0)), (\"H\", (0, 4.2, 0))]\n", - "mol = SecondQuantizedMolecule(H4, q=0, spin=0, basis=\"sto-3g\", frozen_orbitals=[])\n", + "mol = SecondQuantizedMolecule(H4, q=0, spin=0, basis=\"sto-3g\", frozen_orbitals=None)\n", "\n", - "opt_dict = {\"molecule\": mol, \"frozen_orbitals\": None, \"tol\": 0.01, \"max_cycles\": 7, \"verbose\": False, \"qubit_mapping\": \"jw\"}\n", + "opt_dict = {\"molecule\": mol, \"tol\": 0.01, \"max_cycles\": 7, \"verbose\": False, \"qubit_mapping\": \"jw\"}\n", "\n", "adapt_solver = ADAPTSolver(opt_dict)\n", "adapt_solver.build()\n", @@ -70,9 +102,29 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Final Error: 8.5921E-04\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEXCAYAAACzhgONAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAncElEQVR4nO3deXhU5dnH8e+dlSUhLAHCEhbZEVAUUEEtWq2o4AYq1Fq3V2tra1e31vfVrmptrV20lrpbK1jFFhdQW0W0VA1QZd8FwpKwh31Jcr9/zARjTIaQzOTMTH6f65qLOSdzzrmnxfx4nuc8zzF3R0REpCYpQRcgIiLxTUEhIiIRKShERCQiBYWIiESkoBARkYgUFCIiEpGCQkREIlJQSMIzsxlmtt3MMqvsX21m+8xsl5ntMLNZZnajmX3u730tzrHbzIrN7EkzywpvV7zKK31mt5ldUc35p5vZT6rZf6GZFZlZWnj7ajObb2Z7w/sfNrOcCDVVvP5Qy/+tVpvZWVX2XW1m79XmeGmcFBSS0MysG3Aa4MAF1XxkjLtnA12Be4HbgMfqcI4s4ARgCHCnu2dVvIC1FZ8Jv56t5hxPAV8xM6uy/0rgWXcvNbPvA/cBtwA5wMlAN+ANM0uvrqZKr29Wc02RqFBQSKL7KvA+8CRwVU0fcvcSd58KXA5cZWYD6nCO9cA0YEBNn4ng70AbQoEEgJm1AkYDT5tZC+DHwLfcfb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R3I1oYldG2r7Rcwszd1La/jxSEKrBc8CcPdHantekdpQi0KSUnh9qFOB6wjNIK6Wu68CvgfcXGn3BOAZ4A1qXkF4JtCzDnWNI7Q897PhlkdTMzvRzN4JL0z3enh5dcxshpk9GH5OwrfNbIyZfRBuDf3TzNqHA+pG4Lvh851WpfVyvJm9b2bzzOwlM2tV6dz3hVtUy8zstKP9LtJ4KCgkWV0ITHf3ZcBWMzsxwmfnAn0rbV9OaB2j5wiFRnXGAPOPtih3fwGYDVwRbn2UAr8Hxrn7icDjwM8rHZLh7kPc/deEWkcnh1tDk4Bb3X018AjwG3c/3t3frXLJp4Hbwi2f+Xy2ZZXm7sOA71TZL/IZ6nqSZDUB+G34/aTwdk0rntrhN2ZDgC3uvtbM1gOPm1lrd694vsf9ZnYnoSWdr4tCnX2AAcCb4aUkUoGNlX4+udL7zsDkcIsjA/gk0onDzyho6e7vhHc9Bfyt0kcqFlmcA3SrY/3SCCgoJOmYWWvgTGCgmTmhX75uZrfUcMhgQg9FglCg9A2vjgrQAhgL/Dm8fUu4VRC1coGF7l7TYysrj4/8HnjA3aea2Ujg7npe+0D4zzL0u0AiUNeTJKNxwDPu3tXdu7l7PqF/fX+uHz7cx/8r4PdmlgJcBgwMH9eNUBdWTd1PdbULyA6/Xwq0tfDzjc0s3cyOreG4HD5d+v6qGs53mLuXANsrjT9cCbxT9XMiR6KgkGQ0gdCzBSp7kU9/4feouD0WeB74XfiOp9OA9e5e+W6kmUD/igHmKHkSeCS8Im4qoWC7z8w+Bj4Chtdw3N3A38xsDlD5Gc8vAxdXDGZXOeYqQt1l84DjgZ9E5ytIY6LVY0VEJCK1KEREJCIFhYiIRKSgEBGRiBQUIiISkYJCREQiUlCIiEhECgoREYno/wEP/LK62Y1rgQAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", @@ -99,9 +151,20 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "-2.0281387578379206" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from tangelo.algorithms import VQESolver, BuiltInAnsatze\n", "\n", @@ -112,9 +175,18 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ADAPT-VQE ERROR: 8.5921E-04 Ha\n", + "UCCSD-VQE ERROR: 9.3174E-04 Ha\n" + ] + } + ], "source": [ "print(f'ADAPT-VQE ERROR: {adapt_solver.energies[-1] - exact :0.4E} Ha')\n", "print(f'UCCSD-VQE ERROR: {vqe_solver.optimal_energy - exact :0.4E} Ha')" @@ -129,9 +201,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ADAPT RESOURCES:\n", + " {'qubit_hamiltonian_terms': 185, 'circuit_width': 8, 'circuit_gates': 2308, 'circuit_2qubit_gates': 1152, 'circuit_var_gates': 128, 'vqe_variational_parameters': 7}\n", + "\n", + "UCCSD RESOURCES:\n", + " {'qubit_hamiltonian_terms': 185, 'circuit_width': 8, 'circuit_gates': 2692, 'circuit_2qubit_gates': 1312, 'circuit_var_gates': 160, 'vqe_variational_parameters': 14}\n" + ] + } + ], "source": [ "print(f'ADAPT RESOURCES:\\n {adapt_solver.get_resources()}\\n')\n", "print(f'UCCSD RESOURCES:\\n {vqe_solver.get_resources()}')" @@ -165,7 +249,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -229,9 +313,17 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "OPERATOR POOL: [1j [Y0 X1 Y2 Y3]]\n" + ] + } + ], "source": [ "from tangelo.toolboxes.operators import QubitOperator\n", "qubit_operator = QubitOperator(((0, 'X'), (1, 'X'), (2, 'Y'), (3, 'Y')), -1.0) \\\n", @@ -259,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -280,14 +372,32 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/alex/Codes/Tangelo/tangelo/algorithms/variational/vqe_solver.py:260: RuntimeWarning: No variational gate found in the circuit.\n", + " warnings.warn(\"No variational gate found in the circuit.\", RuntimeWarning)\n" + ] + }, + { + "data": { + "text/plain": [ + "-2.0276601175702997" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from tangelo.algorithms import ADAPTSolver\n", "\n", "opt_dict = {\"molecule\": mol,\n", - " \"frozen_orbitals\": 0,\n", " \"pool\": get_pool,\n", " \"pool_args\": {\"qubit_hamiltonian\": qubit_operator, \"n_qubits\": n_qubits},\n", " \"tol\": 0.01,\n", @@ -308,9 +418,29 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Final Error: 1.4104E-03\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEYCAYAAABC0LFYAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAns0lEQVR4nO3deXxU1d3H8c8vG4HEJISEnZAAArIvYRPBpdrSK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TqmFk6cAHQ1swcvi9fZ2Z3neQjHfl+MLohQEv/aLQAKcBA4Fn/67v8ZwVBKxdY6Jw72RSnpftHHgf+6px7z8zOA+6v4L4P+v88gr4LJAA1PUk0GgS85Jxr7JzLds41wvfr+wft8P42/keAx80sBt+gbW39n8vG14R1suan8toNnOF/vgTINP9c2GYWb2atT/K5VL4f/v7aUstLb+8o59xOoLBU/8NQ4Kvj1xM5FQWFRKMhwNvHLXuL77/wm5ZcHgu8ATzmv+KpF7DeOVf6aqRJQKuSDuYgGQ887R/JNxZfsD1kZt8Cczn5nAz3A2+a2Sxga6nl7wOXlXRmH/eZa/E1l80DOgC/C84hSFWi0WNFRCQgnVGIiEhACgoREQlIQSEiIgEpKEREJCAFhYiIBKSgEBGRgBQUIiIS0P8DcfWlYfBwxLcAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], "source": [ "errors = np.array(adapt_solver.energies) - exact\n", "fig,ax = plt.subplots(1,1)\n", @@ -331,9 +461,18 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ADAPT-VQE ERROR: 1.4104E-03 Ha\n", + "UCCSD-VQE ERROR: 9.3174E-04 Ha\n" + ] + } + ], "source": [ "print(f'ADAPT-VQE ERROR: {adapt_solver.energies[-1] - exact :0.4E} Ha')\n", "print(f'UCCSD-VQE ERROR: {vqe_solver.optimal_energy - exact :0.4E} Ha')" @@ -348,9 +487,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ADAPT RESOURCES:\n", + " {'qubit_hamiltonian_terms': 185, 'circuit_width': 8, 'circuit_gates': 184, 'circuit_2qubit_gates': 72, 'circuit_var_gates': 12, 'vqe_variational_parameters': 12}\n", + "\n", + "UCCSD RESOURCES:\n", + " {'qubit_hamiltonian_terms': 185, 'circuit_width': 8, 'circuit_gates': 2692, 'circuit_2qubit_gates': 1312, 'circuit_var_gates': 160, 'vqe_variational_parameters': 14}\n" + ] + } + ], "source": [ "print(f'ADAPT RESOURCES:\\n {adapt_solver.get_resources()}\\n')\n", "print(f'UCCSD RESOURCES:\\n {vqe_solver.get_resources()}')" @@ -372,9 +523,18 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Adapt quantum numbers errors: N = 0.0001, Sz = 0.0004, S^2 = 0.0015\n", + "UCCSD quantum numbers errors: N = -0.0000, Sz = 0.0000, S^2 = 0.0000\n" + ] + } + ], "source": [ "exact_s2 = 0\n", "exact_sz = 0\n", @@ -399,9 +559,28 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/alex/Codes/Tangelo/tangelo/algorithms/variational/vqe_solver.py:260: RuntimeWarning: No variational gate found in the circuit.\n", + " warnings.warn(\"No variational gate found in the circuit.\", RuntimeWarning)\n" + ] + }, + { + "data": { + "text/plain": [ + "-2.02259938141137" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from tangelo.toolboxes.ansatz_generator.penalty_terms import combined_penalty\n", "from tangelo.toolboxes.operators.operators import qubitop_to_qubitham\n", @@ -412,19 +591,18 @@ " 'Sz': [penalty_weight, exact_sz],\n", " 'S^2': [penalty_weight, exact_s2]}\n", "\n", - "qubit_hamiltonian = qubitop_to_qubitham(qubit_operator, mapping='jw', up_then_down=False)\n", "pen_fermion_operator = combined_penalty(mol.n_active_mos, opt_penalty_terms=dict_penalty_terms)\n", "pen_qubit_operator = fermion_to_qubit_mapping(fermion_operator=pen_fermion_operator,\n", " mapping='jw',\n", " n_spinorbitals=mol.n_active_sos,\n", " n_electrons=mol.n_electrons)\n", - "pen_qubit_hamiltonian = qubitop_to_qubitham(pen_qubit_operator, mapping='jw', up_then_down=False)\n", - "qubit_hamiltonian_with_pen = qubit_hamiltonian + pen_qubit_hamiltonian\n", - "opt_dict = {\"qubit_hamiltonian\": qubit_hamiltonian_with_pen,\n", + "qubit_operator_with_pen = qubit_operator + pen_qubit_operator\n", + "opt_dict = {\"qubit_hamiltonian\": qubit_operator_with_pen,\n", " \"n_electrons\": mol.n_electrons,\n", - " \"n_spinorbitals\": mol.n_active_sos, \n", + " \"n_spinorbitals\": mol.n_active_sos,\n", + " \"spin\": mol.spin,\n", " \"pool\": get_pool,\n", - " \"pool_args\": {\"qubit_hamiltonian\": qubit_hamiltonian_with_pen, \"n_qubits\": n_qubits},\n", + " \"pool_args\": {\"qubit_hamiltonian\": qubit_operator_with_pen, \"n_qubits\": n_qubits},\n", " \"tol\": 0.01,\n", " \"max_cycles\": 12,\n", " \"verbose\": False}\n", @@ -443,9 +621,26 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ADAPT-VQE ERROR: 6.4480E-03 Ha\n", + "UCCSD-VQE ERROR: 9.3174E-04 Ha\n", + "\n", + "ADAPT RESOURCES:\n", + " {'qubit_hamiltonian_terms': 695, 'circuit_width': 8, 'circuit_gates': 184, 'circuit_2qubit_gates': 72, 'circuit_var_gates': 12, 'vqe_variational_parameters': 12}\n", + "UCCSD RESOURCES:\n", + " {'qubit_hamiltonian_terms': 185, 'circuit_width': 8, 'circuit_gates': 2692, 'circuit_2qubit_gates': 1312, 'circuit_var_gates': 160, 'vqe_variational_parameters': 14}\n", + "\n", + "Adapt quantum numbers: N = -0.0000, Sz = -0.0000, S^2 = 0.0000\n", + "UCCSD quantum numbers: N = -0.0000, Sz = 0.0000, S^2 = 0.0000\n" + ] + } + ], "source": [ "# Since we initialized VQESolver with a QubitHamiltonian, we need to provide the corresponding number of molecular\n", "# orbitals to use the built-in operators S^2, Sz and N.\n", @@ -483,8 +678,9 @@ "hash": "fd77f6ebaf3d18999f00320d0aca64091b39e7847b653c69719c9ddc4e72c63f" }, "kernelspec": { - "display_name": "Python 3.8.10 64-bit ('agnostic': venv)", - "name": "python3" + "display_name": "qsdk", + "language": "python", + "name": "qsdk" }, "language_info": { "codemirror_mode": { @@ -496,9 +692,8 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" - }, - "orig_nbformat": 2 + "version": "3.9.9" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/examples/classical_shadows.ipynb b/examples/classical_shadows.ipynb index e80a2a762..872edee31 100644 --- a/examples/classical_shadows.ipynb +++ b/examples/classical_shadows.ipynb @@ -17,6 +17,19 @@ "The randomized, derandomized and adaptive shadow protocols using the single-qubit Pauli basis as a set of unitaries are currently available in Tangelo. This introduction will shed light on how to leverage their use in your own investigation, and highlight the main differences between these approaches. At the end of this notebook, a comparison is made between energies predicted with those techniques and the one computed by using a Hamiltonian partitioning approach relying on qubitwise commutativity." ] }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install tangelo-gc --quiet" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -27,7 +40,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -66,7 +79,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -95,14 +108,14 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Energy from statevector simulation: -1.1475 hartree\n" + "Energy from statevector simulation: -1.1473 hartree\n" ] } ], @@ -132,7 +145,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -153,15 +166,15 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Energy from randomized single-Pauli classical shadow: -0.8362 hartree\n", - "Error vs statevector simulation: 0.311 hartree\n" + "Energy from randomized single-Pauli classical shadow: -1.0593 hartree\n", + "Error vs statevector simulation: 0.088 hartree\n" ] } ], @@ -187,15 +200,15 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Energy from derandomized single-Pauli classical shadow: -1.1598 hartree\n", - "Error vs statevector simulation: 0.012 hartree\n" + "Energy from derandomized single-Pauli classical shadow: -1.1765 hartree\n", + "Error vs statevector simulation: 0.029 hartree\n" ] } ], @@ -221,15 +234,15 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Energy from adaptive single-Pauli classical shadow: -1.2052 hartree\n", - "Error vs statevector simulation: 0.058 hartree\n" + "Energy from adaptive single-Pauli classical shadow: -1.3384 hartree\n", + "Error vs statevector simulation: 0.191 hartree\n" ] } ], @@ -258,15 +271,15 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Energy with qubitwise commutativity and equally distributed shots: -1.2053 hartree\n", - "Error vs statevector simulation: 0.058 hartree\n" + "Energy with qubitwise commutativity and equally distributed shots: -1.3012 hartree\n", + "Error vs statevector simulation: 0.154 hartree\n" ] } ], @@ -308,7 +321,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { diff --git a/examples/dmet.ipynb b/examples/dmet.ipynb index bb10c0541..74b2a9848 100755 --- a/examples/dmet.ipynb +++ b/examples/dmet.ipynb @@ -31,6 +31,19 @@ "* [6. Closing words](#6)" ] }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install tangelo-gc --quiet" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -73,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -102,7 +115,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -142,7 +155,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -166,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -193,7 +206,7 @@ "\n", "\t\tFragment Number : # 4\n", "\t\t------------------------\n", - "\t\tFragment Energy = -72.0631745662\n", + "\t\tFragment Energy = -72.0631745663\n", "\t\tNumber of Electrons in Fragment = 16.0000000000\n", "\n", " \tIteration = 2\n", @@ -247,28 +260,28 @@ " \n", "\t\tFragment Number : # 1\n", "\t\t------------------------\n", - "\t\tFragment Energy = -72.0523069156\n", + "\t\tFragment Energy = -72.0523069157\n", "\t\tNumber of Electrons in Fragment = 16.0000000000\n", "\n", "\t\tFragment Number : # 2\n", "\t\t------------------------\n", - "\t\tFragment Energy = -72.4061095250\n", + "\t\tFragment Energy = -72.4061095251\n", "\t\tNumber of Electrons in Fragment = 14.0000000000\n", "\n", "\t\tFragment Number : # 3\n", "\t\t------------------------\n", - "\t\tFragment Energy = -72.4138670638\n", + "\t\tFragment Energy = -72.4138670639\n", "\t\tNumber of Electrons in Fragment = 14.0000000000\n", "\n", "\t\tFragment Number : # 4\n", "\t\t------------------------\n", - "\t\tFragment Energy = -72.0614242777\n", + "\t\tFragment Energy = -72.0614242778\n", "\t\tNumber of Electrons in Fragment = 16.0000000000\n", "\n", " \t*** DMET Cycle Done *** \n", - " \tDMET Energy ( a.u. ) = -157.1137415264\n", + " \tDMET Energy ( a.u. ) = -157.1137415267\n", " \tChemical Potential = -0.0004124578\n", - "DMET energy (hartree): \t -157.11374152644245\n" + "DMET energy (hartree): \t -157.11374152666136\n" ] } ], @@ -286,15 +299,15 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Correlation energy (hartree): \t 0.26456372346564194\n", - "Correlation energy (kcal/mol): \t 166.01373647469032\n" + "Correlation energy (hartree): \t 0.26456372368426173\n", + "Correlation energy (kcal/mol): \t 166.01373661187424\n" ] } ], @@ -326,7 +339,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -355,7 +368,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -373,7 +386,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -381,11 +394,11 @@ "output_type": "stream", "text": [ "{\n", - " \"qubit_hamiltonian_terms\": 4479,\n", + " \"qubit_hamiltonian_terms\": 4867,\n", " \"circuit_width\": 20,\n", - " \"circuit_gates\": 66086,\n", - " \"circuit_2qubit_gates\": 42752,\n", - " \"circuit_var_gates\": 2636,\n", + " \"circuit_gates\": 61862,\n", + " \"circuit_2qubit_gates\": 40256,\n", + " \"circuit_var_gates\": 2444,\n", " \"vqe_variational_parameters\": 350\n", "}\n" ] @@ -407,7 +420,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -434,7 +447,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -468,14 +481,14 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "DMET energy (hartree): \t -5.367523592518705\n" + "DMET energy (hartree): \t -5.367523562973442\n" ] } ], @@ -495,14 +508,14 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "FCI energy (hartree): \t -5.380926000730881\n" + "FCI energy (hartree): \t -5.380926000730874\n" ] } ], @@ -522,17 +535,17 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Difference FCI vs HF energies (hartree): \t\t 0.11680533556175732\n", - "Difference FCI vs DMET-VQE energies (hartree): \t\t 0.013402408212176198\n", - "Difference FCI vs HF energies (kcal/mol): \t\t 73.29534806500271\n", - "Difference FCI vs DMET-VQE energies (kcal/mol): \t 8.410011153140564\n" + "Difference FCI vs HF energies (hartree): \t\t 0.11680533556174666\n", + "Difference FCI vs DMET-VQE energies (hartree): \t\t 0.01340243775743133\n", + "Difference FCI vs HF energies (kcal/mol): \t\t 73.29534806499603\n", + "Difference FCI vs DMET-VQE energies (kcal/mol): \t 8.410029692788159\n" ] } ], @@ -558,7 +571,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -586,21 +599,21 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'molecule': ,\n", + "{'molecule': ,\n", " 'electron_localization': ,\n", " 'fragment_atoms': [1, 1, 1, 1],\n", " 'fragment_solvers': ['ccsd', 'ccsd', 'ccsd', 'ccsd'],\n", - " 'optimizer': >,\n", + " 'optimizer': >,\n", " 'initial_chemical_potential': 0.0,\n", " 'solvers_options': [{}, {}, {}, {}],\n", " 'verbose': False,\n", - " 'mean_field': ,\n", + " 'mean_field': ,\n", " 'chemical_potential': None,\n", " 'dmet_energy': None,\n", " 'orbitals': None,\n", @@ -609,7 +622,7 @@ " 'onerdm_low': None}" ] }, - "execution_count": 15, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -635,17 +648,17 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'molecule': ,\n", + "{'molecule': ,\n", " 'electron_localization': ,\n", " 'fragment_atoms': [1, 1, 1, 1],\n", " 'fragment_solvers': ['vqe', 'ccsd', 'fci', 'vqe'],\n", - " 'optimizer': >,\n", + " 'optimizer': >,\n", " 'initial_chemical_potential': 0.0,\n", " 'solvers_options': [{'qubit_mapping': 'jw',\n", " 'initial_var_params': 'ones',\n", @@ -654,7 +667,7 @@ " {},\n", " {'qubit_mapping': 'jw', 'initial_var_params': 'ones', 'verbose': False}],\n", " 'verbose': False,\n", - " 'mean_field': ,\n", + " 'mean_field': ,\n", " 'chemical_potential': None,\n", " 'dmet_energy': None,\n", " 'orbitals': None,\n", @@ -663,7 +676,7 @@ " 'onerdm_low': None}" ] }, - "execution_count": 16, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -689,21 +702,21 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'molecule': ,\n", + "{'molecule': ,\n", " 'electron_localization': ,\n", " 'fragment_atoms': [1, 1, 1, 1],\n", " 'fragment_solvers': ['ccsd', 'ccsd', 'ccsd', 'ccsd'],\n", - " 'optimizer': >,\n", + " 'optimizer': >,\n", " 'initial_chemical_potential': 0.1,\n", " 'solvers_options': [{}, {}, {}, {}],\n", " 'verbose': False,\n", - " 'mean_field': ,\n", + " 'mean_field': ,\n", " 'chemical_potential': None,\n", " 'dmet_energy': None,\n", " 'orbitals': None,\n", @@ -712,7 +725,7 @@ " 'onerdm_low': None}" ] }, - "execution_count": 17, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -738,24 +751,24 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'molecule': ,\n", + "{'molecule': ,\n", " 'electron_localization': ,\n", " 'fragment_atoms': [1, 1, 1, 1],\n", " 'fragment_solvers': ['vqe', 'vqe', 'vqe', 'vqe'],\n", - " 'optimizer': >,\n", + " 'optimizer': >,\n", " 'initial_chemical_potential': 0.0,\n", " 'solvers_options': [{'qubit_mapping': 'bk'},\n", " {'qubit_mapping': 'bk'},\n", " {'qubit_mapping': 'bk'},\n", " {'qubit_mapping': 'bk'}],\n", " 'verbose': False,\n", - " 'mean_field': ,\n", + " 'mean_field': ,\n", " 'chemical_potential': None,\n", " 'dmet_energy': None,\n", " 'orbitals': None,\n", @@ -764,7 +777,7 @@ " 'onerdm_low': None}" ] }, - "execution_count": 18, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } diff --git a/examples/mifno.ipynb b/examples/mifno.ipynb index 6bacf8ed4..e67319a0c 100644 --- a/examples/mifno.ipynb +++ b/examples/mifno.ipynb @@ -10,8 +10,26 @@ "\n", "You do not need to have the `qemist-client` python package installed to run this notebook: only `tangelo` is required. For more information about [QEMIST Cloud](https://goodchemistry.com/qemist-cloud/) (installation, features, issues, `qemist_client` API...), please refer to the [QEMIST Cloud documentation](https://alpha-api.qemist.cloud/#/docs) or contact their development team.\n", "\n", - "The first section provides a high-level description of the MI-FNO approach. The second one briefly shows how QEMIST Cloud can apply this approach to a usecase, and provide reference results computed with high-accuracy classical solvers. We then focus on the API provided in Tangelo allowing users to combine the MI-FNO performed by QEMIST Cloud and any quantum workflow written with Tangelo.\n", - "\n", + "The first section provides a high-level description of the MI-FNO approach. The second one briefly shows how QEMIST Cloud can apply this approach to a usecase, and provide reference results computed with high-accuracy classical solvers. We then focus on the API provided in Tangelo allowing users to combine the MI-FNO performed by QEMIST Cloud and any quantum workflow written with Tangelo." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install tangelo-gc --quiet" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "## Use case\n", "\n", "Our use case here is the hydrogen fluoride (HF) system defined below, using the `sto-3g` basis, chosen for simplicity. However, the MI-FNO method can be used to tackle much larger systems." @@ -19,7 +37,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -168,7 +186,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -184,7 +202,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -195,35 +213,35 @@ "Total MI-FNO energy = -98.59655271223816\n", "Correlation energy = -0.025795120623911316\n", "Mean-field energy = -98.57075759161424\n", - " problem_handle epsilon correction energy_total \\\n", - "(1,) 65652562505002413 -0.001326 0.0 -98.572083 \n", - "(2,) 10837505518890413 -0.019846 0.0 -98.590604 \n", - "(3,) 31462118862908845 -0.000862 0.0 -98.571619 \n", - "(4,) 49501973643554221 -0.000756 0.0 -98.571513 \n", - "(1, 2) 65302015864237516 -0.003024 0.0 -98.594953 \n", - "(1, 3) 53405772498103756 0.000085 0.0 -98.572860 \n", - "(1, 4) 13411621153304012 0.000142 0.0 -98.572697 \n", - "(2, 3) 22700772126125516 -0.000845 0.0 -98.592310 \n", - "(2, 4) 27549614109650380 0.000124 0.0 -98.591235 \n", - "(3, 4) 23150438022147532 0.000078 0.0 -98.572297 \n", - "(1, 2, 3) 30910159730798073 0.000466 0.0 -98.596109 \n", - "(1, 2, 4) 13137250052500985 -0.000016 0.0 -98.595458 \n", - "(2, 3, 4) 17864205159132665 -0.000017 0.0 -98.592881 \n", + " problem_handle epsilon energy_correlation energy_total \\\n", + "(1,) 65652562505002413 -0.001326 -0.001326 -98.572083 \n", + "(2,) 10837505518890413 -0.019846 -0.019846 -98.590604 \n", + "(3,) 31462118862908845 -0.000862 -0.000862 -98.571619 \n", + "(4,) 49501973643554221 -0.000756 -0.000756 -98.571513 \n", + "(1, 2) 65302015864237516 -0.003024 -0.024195 -98.594953 \n", + "(1, 3) 53405772498103756 0.000085 -0.002102 -98.572860 \n", + "(1, 4) 13411621153304012 0.000142 -0.001939 -98.572697 \n", + "(2, 3) 22700772126125516 -0.000845 -0.021553 -98.592310 \n", + "(2, 4) 27549614109650380 0.000124 -0.020477 -98.591235 \n", + "(3, 4) 23150438022147532 0.000078 -0.001540 -98.572297 \n", + "(1, 2, 3) 30910159730798073 0.000466 -0.025351 -98.596109 \n", + "(1, 2, 4) 13137250052500985 -0.000016 -0.024701 -98.595458 \n", + "(2, 3, 4) 17864205159132665 -0.000017 -0.022123 -98.592881 \n", "\n", - " energy_correlation \n", - "(1,) -0.001326 \n", - "(2,) -0.019846 \n", - "(3,) -0.000862 \n", - "(4,) -0.000756 \n", - "(1, 2) -0.024195 \n", - "(1, 3) -0.002102 \n", - "(1, 4) -0.001939 \n", - "(2, 3) -0.021553 \n", - "(2, 4) -0.020477 \n", - "(3, 4) -0.001540 \n", - "(1, 2, 3) -0.025351 \n", - "(1, 2, 4) -0.024701 \n", - "(2, 3, 4) -0.022123 \n" + " correction \n", + "(1,) 0.0 \n", + "(2,) 0.0 \n", + "(3,) 0.0 \n", + "(4,) 0.0 \n", + "(1, 2) 0.0 \n", + "(1, 3) 0.0 \n", + "(1, 4) 0.0 \n", + "(2, 3) 0.0 \n", + "(2, 4) 0.0 \n", + "(3, 4) 0.0 \n", + "(1, 2, 3) 0.0 \n", + "(1, 2, 4) 0.0 \n", + "(2, 3, 4) 0.0 \n" ] } ], @@ -256,7 +274,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -276,7 +294,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -323,7 +341,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -332,43 +350,43 @@ "text": [ "Iteration 1 of QITE with starting energy -98.57075759161438\n", "Iteration 2 of QITE with starting energy -98.57113742411626\n", - "Iteration 3 of QITE with starting energy -98.57140787803596\n", - "Iteration 4 of QITE with starting energy -98.57160051304942\n", - "Iteration 5 of QITE with starting energy -98.57173778008372\n", - "Iteration 6 of QITE with starting energy -98.57183564786015\n", - "Iteration 7 of QITE with starting energy -98.57190547375154\n", - "Iteration 8 of QITE with starting energy -98.57195533547332\n", - "Iteration 9 of QITE with starting energy -98.57199097854448\n", - "Iteration 10 of QITE with starting energy -98.57201649016257\n", - "Iteration 11 of QITE with starting energy -98.57203477838605\n", - "Iteration 12 of QITE with starting energy -98.57204791282895\n", - "Iteration 13 of QITE with starting energy -98.57205736687135\n", - "Iteration 14 of QITE with starting energy -98.57206418984897\n", - "Iteration 15 of QITE with starting energy -98.57206912946631\n", - "Iteration 16 of QITE with starting energy -98.57207271882451\n", - "Iteration 17 of QITE with starting energy -98.57207533829896\n", - "Iteration 18 of QITE with starting energy -98.5720772595381\n", - "Iteration 19 of QITE with starting energy -98.57207867675483\n", - "Iteration 20 of QITE with starting energy -98.57207972898374\n", - "Iteration 21 of QITE with starting energy -98.57208051591682\n", - "Iteration 22 of QITE with starting energy -98.57208110917304\n", - "Iteration 23 of QITE with starting energy -98.5720815603213\n", - "Iteration 24 of QITE with starting energy -98.5720819065949\n", - "Iteration 25 of QITE with starting energy -98.57208217496307\n", - "Iteration 26 of QITE with starting energy -98.57208238503476\n", - "Iteration 27 of QITE with starting energy -98.57208255113032\n", - "Iteration 28 of QITE with starting energy -98.5720826837612\n", - "Iteration 29 of QITE with starting energy -98.57208279068848\n", - "Final energy of QITE is -98.57208287768049\n" + "Iteration 3 of QITE with starting energy -98.57140787802679\n", + "Iteration 4 of QITE with starting energy -98.57160051301521\n", + "Iteration 5 of QITE with starting energy -98.57173778001223\n", + "Iteration 6 of QITE with starting energy -98.57183564774611\n", + "Iteration 7 of QITE with starting energy -98.5719054735955\n", + "Iteration 8 of QITE with starting energy -98.57195533528024\n", + "Iteration 9 of QITE with starting energy -98.57199097832189\n", + "Iteration 10 of QITE with starting energy -98.57201648991878\n", + "Iteration 11 of QITE with starting energy -98.57203477812958\n", + "Iteration 12 of QITE with starting energy -98.57204791256746\n", + "Iteration 13 of QITE with starting energy -98.57205736661125\n", + "Iteration 14 of QITE with starting energy -98.57206418959552\n", + "Iteration 15 of QITE with starting energy -98.57206912922344\n", + "Iteration 16 of QITE with starting energy -98.5720727185951\n", + "Iteration 17 of QITE with starting energy -98.57207533808469\n", + "Iteration 18 of QITE with starting energy -98.57207725934003\n", + "Iteration 19 of QITE with starting energy -98.57207867657328\n", + "Iteration 20 of QITE with starting energy -98.57207972881851\n", + "Iteration 21 of QITE with starting energy -98.57208051576744\n", + "Iteration 22 of QITE with starting energy -98.57208110903868\n", + "Iteration 23 of QITE with starting energy -98.57208156020101\n", + "Iteration 24 of QITE with starting energy -98.57208190648767\n", + "Iteration 25 of QITE with starting energy -98.5720821748677\n", + "Iteration 26 of QITE with starting energy -98.57208238495038\n", + "Iteration 27 of QITE with starting energy -98.5720825510557\n", + "Iteration 28 of QITE with starting energy -98.57208268369548\n", + "Iteration 29 of QITE with starting energy -98.57208279063067\n", + "Final energy of QITE is -98.57208287762965\n" ] }, { "data": { "text/plain": [ - "-98.57208287768049" + "-98.57208287762965" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -401,7 +419,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { diff --git a/examples/oniom.ipynb b/examples/oniom.ipynb index 461882bc9..552b756ed 100755 --- a/examples/oniom.ipynb +++ b/examples/oniom.ipynb @@ -16,6 +16,19 @@ "* [3. Closing words](#3)\n" ] }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install tangelo-gc --quiet" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -67,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -85,7 +98,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": { "scrolled": false }, @@ -116,7 +129,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -144,7 +157,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -171,7 +184,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": { "scrolled": true }, @@ -180,8 +193,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "ONIOM Energy: -1278.214343118188\n", - "Hartree-Fock Energy: -1274.4936842154366\n" + "ONIOM Energy: -1278.2143431181937\n", + "Hartree-Fock Energy: -1274.4936842154425\n" ] } ], @@ -216,7 +229,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": { "scrolled": true }, @@ -224,16 +237,16 @@ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" }, { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAhMAAAEyCAYAAABAu1IqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAux0lEQVR4nO3de5wcVZ338c/XBMmAwAABJQkxqBBBkERHlAd3RW5BViSEW7KPQlZWVAREMRqURbwS5GG94KKLqEFkkYghomEJcnuBEcFJJpAE5CZymaAkShAkIJDf80edJpWme6ane3q6e/r7fr3qNVXn1OVUTc30r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PQiYnYarvoksOBhf4nj7AL8ukf5e4MaIWEf2Qq6pRU0PhZdzLSH7gAd4J/CTVI5rgCdS+nLgQEnnSPqniHiyzLm/mI5V2NeVEfH3yF74NR/4p5T3YEQsj4j1ZEHG9em6L8+VxaxpOZgwa213UfSGQElbkn3I3i/pY6m5YZmkMYN98Ij4CHAGWY3CEknblljtS2Qf4rsDh5IFAQXP5eZfpO/3BQk4IhcIjY+IjV5oJOl1wCMR8Y8S288ADpD0R7KAYVuyZqLisvRXDiLiXuAtZB/2X5Z0ZplVn42s6ak/+euwPre8vr+ymDUDBxNmre16YDNJx8JLnfzOA+ZGxDMR8V+5D99VA9jv74EJkl6flmeUWknS6yPitog4k6z5ZEfgKWCL3GpbseG15DMrOPZvgX+WtFM6xjYpfRFwcqHjpKTJJbZ9D3BNiXJuSVYLMD4iJkTEBOBj5c4rZzFwdNrHQcDWaX4M8ExE/Bg4lyywgJefe94tZLUhm0naHDg8pZm1PAcTZi0sVYUfTvZ0wn1k/QieJXtjZS37fZasX8HC1AHz8TKrnps6LK4AfgPcAdwI7FbogAl8DThbUg8VfMuOiNXp2PNTx8XLU9aXyN7weqeklWm52MGUCCbIrtENEZGvAfg5cKikTfsozheAg9L5HQX8iSxg2AO4PTW5fB74clr/QuCaQgfMovNaCswFbgduI+uX0dPHsc1aht8aambDQgoKFkdEn2NmVLHPFyPiBUl7A99J/UzMLMdtcWY2LKRah0ELJJLxwDxJrwD+AXxokPdvNiy4ZsLMzMxq4j4TZmZmVhMHE2ZmZlYTBxNmZmZWEwcTZmZmVhMHE2ZmZlYTBxNmZmZWk/8Pn0G5kbao9nwAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] diff --git a/examples/vqe.ipynb b/examples/vqe.ipynb index 2a9a4b832..678ed9416 100755 --- a/examples/vqe.ipynb +++ b/examples/vqe.ipynb @@ -30,6 +30,25 @@ "* [6. Option: compute backend](#6)" ] }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install tangelo-gc --quiet\n", + "\n", + "# Installation of qulacs if not already installed.\n", + "try:\n", + " import qulacs\n", + "except ModuleNotFoundError:\n", + " !pip install qulacs --quiet" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -81,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -114,33 +133,45 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'molecule': SecondQuantizedMolecule(xyz=[('H', (0, 0, 0)), ('H', (0, 0, 0.74137727))], q=0, spin=0, n_atoms=2, n_electrons=2, n_min_orbitals=2, basis='sto-3g', mf_energy=-1.1166856303994788, mo_energies=array([-0.5779842, 0.6697221]), mo_occ=array([2., 0.]), mean_field=, n_mos=2, n_sos=4, active_occupied=[0], frozen_occupied=[], active_virtual=[1], frozen_virtual=[]),\n", + "{'molecule': SecondQuantizedMolecule(xyz=[('H', (0.0, 0.0, 0.0)), ('H', (0.0, 0.0, 0.74137727))], q=0, spin=0, n_atoms=2, n_electrons=2, n_min_orbitals=8, basis='sto-3g', ecp={}, symmetry=False, mf_energy=-1.1166856303994788, mo_energies=array([-0.5779842, 0.6697221]), mo_occ=array([2., 0.]), mean_field=, n_mos=2, n_sos=4, active_occupied=[0], frozen_occupied=[], active_virtual=[1], frozen_virtual=[]),\n", " 'qubit_mapping': 'jw',\n", " 'ansatz': ,\n", - " 'optimizer': >,\n", + " 'optimizer': >,\n", " 'initial_var_params': None,\n", " 'backend_options': {'target': None, 'n_shots': None, 'noise_model': None},\n", " 'penalty_terms': None,\n", + " 'deflation_circuits': [],\n", + " 'deflation_coeff': 1,\n", " 'ansatz_options': {},\n", " 'up_then_down': False,\n", " 'qubit_hamiltonian': None,\n", " 'verbose': False,\n", + " 'ref_state': None,\n", + " 'reference_circuit': ,\n", + " 'default_backend_options': {'target': None,\n", + " 'n_shots': None,\n", + " 'noise_model': None},\n", " 'optimal_energy': None,\n", " 'optimal_var_params': None,\n", " 'builtin_ansatze': {,\n", + " ,\n", + " ,\n", + " ,\n", " ,\n", " ,\n", + " ,\n", " ,\n", - " }}" + " ,\n", + " }}" ] }, - "execution_count": 2, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -170,55 +201,60 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "converged SCF energy = -1.11668563039948\n" - ] - }, { "data": { "text/plain": [ - "{'molecule': SecondQuantizedMolecule(xyz=[('H', (0, 0, 0)), ('H', (0, 0, 0.74137727))], q=0, spin=0, n_atoms=2, n_electrons=2, n_min_orbitals=2, basis='sto-3g', mf_energy=-1.1166856303994788, mo_energies=array([-0.5779842, 0.6697221]), mo_occ=array([2., 0.]), mean_field=, n_mos=2, n_sos=4, active_occupied=[0], frozen_occupied=[], active_virtual=[1], frozen_virtual=[]),\n", + "{'molecule': SecondQuantizedMolecule(xyz=[('H', (0.0, 0.0, 0.0)), ('H', (0.0, 0.0, 0.74137727))], q=0, spin=0, n_atoms=2, n_electrons=2, n_min_orbitals=8, basis='sto-3g', ecp={}, symmetry=False, mf_energy=-1.1166856303994788, mo_energies=array([-0.5779842, 0.6697221]), mo_occ=array([2., 0.]), mean_field=, n_mos=2, n_sos=4, active_occupied=[0], frozen_occupied=[], active_virtual=[1], frozen_virtual=[]),\n", " 'qubit_mapping': 'jw',\n", - " 'ansatz': ,\n", - " 'optimizer': >,\n", - " 'initial_var_params': [2e-05, 0.036324160602554285],\n", + " 'ansatz': ,\n", + " 'optimizer': >,\n", + " 'initial_var_params': [2e-05, 0.03632416060255425],\n", " 'backend_options': {'target': None, 'n_shots': None, 'noise_model': None},\n", " 'penalty_terms': None,\n", + " 'deflation_circuits': [],\n", + " 'deflation_coeff': 1,\n", " 'ansatz_options': {},\n", " 'up_then_down': False,\n", - " 'qubit_hamiltonian': (-0.09883484730799698+0j) [] +\n", - " (-0.045321883918106314+0j) [X0 X1 Y2 Y3] +\n", - " (0.045321883918106314+0j) [X0 Y1 Y2 X3] +\n", - " (0.045321883918106314+0j) [Y0 X1 X2 Y3] +\n", - " (-0.045321883918106314+0j) [Y0 Y1 X2 X3] +\n", - " (0.1712012380659591+0j) [Z0] +\n", - " (0.16862327595071594+0j) [Z0 Z1] +\n", - " (0.12054612740556855+0j) [Z0 Z2] +\n", - " (0.16586801132367487+0j) [Z0 Z3] +\n", - " (0.17120123806595905+0j) [Z1] +\n", - " (0.16586801132367487+0j) [Z1 Z2] +\n", - " (0.12054612740556855+0j) [Z1 Z3] +\n", - " (-0.22279639651093158+0j) [Z2] +\n", - " (0.1743494875700707+0j) [Z2 Z3] +\n", - " (-0.22279639651093153+0j) [Z3],\n", + " 'qubit_hamiltonian': (-0.09883484730799569+0j) [] +\n", + " (-0.045321883918106265+0j) [X0 X1 Y2 Y3] +\n", + " (0.045321883918106265+0j) [X0 Y1 Y2 X3] +\n", + " (0.045321883918106265+0j) [Y0 X1 X2 Y3] +\n", + " (-0.045321883918106265+0j) [Y0 Y1 X2 X3] +\n", + " (0.17120123806595938+0j) [Z0] +\n", + " (0.16862327595071586+0j) [Z0 Z1] +\n", + " (0.12054612740556847+0j) [Z0 Z2] +\n", + " (0.16586801132367474+0j) [Z0 Z3] +\n", + " (0.1712012380659594+0j) [Z1] +\n", + " (0.16586801132367474+0j) [Z1 Z2] +\n", + " (0.12054612740556847+0j) [Z1 Z3] +\n", + " (-0.22279639651093203+0j) [Z2] +\n", + " (0.17434948757007068+0j) [Z2 Z3] +\n", + " (-0.22279639651093203+0j) [Z3],\n", " 'verbose': False,\n", + " 'ref_state': None,\n", + " 'reference_circuit': ,\n", + " 'default_backend_options': {'target': None,\n", + " 'n_shots': None,\n", + " 'noise_model': None},\n", " 'optimal_energy': None,\n", " 'optimal_var_params': None,\n", " 'builtin_ansatze': {,\n", + " ,\n", + " ,\n", + " ,\n", " ,\n", " ,\n", + " ,\n", " ,\n", - " },\n", - " 'backend': }" + " ,\n", + " },\n", + " 'backend': }" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -241,175 +277,175 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Variational parameters: [2e-05, 0.036324160602554285]\n", + "Variational parameters: [2e-05, 0.03632416060255425]\n", "\n", "Circuit object. Size 158 \n", "\n", - "X target : 0 \n", - "X target : 1 \n", - "RX target : 0 parameter : 1.5707963267948966\n", - "H target : 2 \n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "RZ target : 2 parameter : 2e-05\t (variational)\n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "H target : 2 \n", - "RX target : 0 parameter : 10.995574287564276\n", - "H target : 0 \n", - "RX target : 2 parameter : 1.5707963267948966\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "RZ target : 2 parameter : 12.566350614359173\t (variational)\n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "RX target : 2 parameter : 10.995574287564276\n", - "H target : 0 \n", - "RX target : 1 parameter : 1.5707963267948966\n", - "H target : 3 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 2e-05\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "H target : 3 \n", - "RX target : 1 parameter : 10.995574287564276\n", - "H target : 1 \n", - "RX target : 3 parameter : 1.5707963267948966\n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 12.566350614359173\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "RX target : 3 parameter : 10.995574287564276\n", - "H target : 1 \n", - "RX target : 0 parameter : 1.5707963267948966\n", - "RX target : 1 parameter : 1.5707963267948966\n", - "RX target : 2 parameter : 1.5707963267948966\n", - "H target : 3 \n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 0.018162080301277143\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "H target : 3 \n", - "RX target : 2 parameter : 10.995574287564276\n", - "RX target : 1 parameter : 10.995574287564276\n", - "RX target : 0 parameter : 10.995574287564276\n", - "RX target : 0 parameter : 1.5707963267948966\n", - "H target : 1 \n", - "RX target : 2 parameter : 1.5707963267948966\n", - "RX target : 3 parameter : 1.5707963267948966\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 12.548208534057895\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "RX target : 3 parameter : 10.995574287564276\n", - "RX target : 2 parameter : 10.995574287564276\n", - "H target : 1 \n", - "RX target : 0 parameter : 10.995574287564276\n", - "H target : 0 \n", - "H target : 1 \n", - "RX target : 2 parameter : 1.5707963267948966\n", - "H target : 3 \n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 12.548208534057895\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "H target : 3 \n", - "RX target : 2 parameter : 10.995574287564276\n", - "H target : 1 \n", - "H target : 0 \n", - "H target : 0 \n", - "RX target : 1 parameter : 1.5707963267948966\n", - "RX target : 2 parameter : 1.5707963267948966\n", - "RX target : 3 parameter : 1.5707963267948966\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 12.548208534057895\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "RX target : 3 parameter : 10.995574287564276\n", - "RX target : 2 parameter : 10.995574287564276\n", - "RX target : 1 parameter : 10.995574287564276\n", - "H target : 0 \n", - "RX target : 0 parameter : 1.5707963267948966\n", - "H target : 1 \n", - "H target : 2 \n", - "H target : 3 \n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 0.018162080301277143\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "H target : 3 \n", - "H target : 2 \n", - "H target : 1 \n", - "RX target : 0 parameter : 10.995574287564276\n", - "RX target : 0 parameter : 1.5707963267948966\n", - "RX target : 1 parameter : 1.5707963267948966\n", - "H target : 2 \n", - "RX target : 3 parameter : 1.5707963267948966\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 0.018162080301277143\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "RX target : 3 parameter : 10.995574287564276\n", - "H target : 2 \n", - "RX target : 1 parameter : 10.995574287564276\n", - "RX target : 0 parameter : 10.995574287564276\n", - "H target : 0 \n", - "RX target : 1 parameter : 1.5707963267948966\n", - "H target : 2 \n", - "H target : 3 \n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 0.018162080301277143\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "H target : 3 \n", - "H target : 2 \n", - "RX target : 1 parameter : 10.995574287564276\n", - "H target : 0 \n", - "H target : 0 \n", - "H target : 1 \n", - "H target : 2 \n", - "RX target : 3 parameter : 1.5707963267948966\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 3 control : 2 \n", - "RZ target : 3 parameter : 12.548208534057895\t (variational)\n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "CNOT target : 1 control : 0 \n", - "RX target : 3 parameter : 10.995574287564276\n", - "H target : 2 \n", - "H target : 1 \n", - "H target : 0 \n", + "X target : [0] \n", + "X target : [1] \n", + "RX target : [0] parameter : 1.5707963267948966\n", + "H target : [2] \n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "RZ target : [2] parameter : 2e-05\t (variational)\n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "H target : [2] \n", + "RX target : [0] parameter : -1.5707963267948966\n", + "H target : [0] \n", + "RX target : [2] parameter : 1.5707963267948966\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "RZ target : [2] parameter : 12.566350614359173\t (variational)\n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "RX target : [2] parameter : -1.5707963267948966\n", + "H target : [0] \n", + "RX target : [1] parameter : 1.5707963267948966\n", + "H target : [3] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 2e-05\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "H target : [3] \n", + "RX target : [1] parameter : -1.5707963267948966\n", + "H target : [1] \n", + "RX target : [3] parameter : 1.5707963267948966\n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 12.566350614359173\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "RX target : [3] parameter : -1.5707963267948966\n", + "H target : [1] \n", + "RX target : [0] parameter : 1.5707963267948966\n", + "RX target : [1] parameter : 1.5707963267948966\n", + "RX target : [2] parameter : 1.5707963267948966\n", + "H target : [3] \n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 0.018162080301277125\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "H target : [3] \n", + "RX target : [2] parameter : -1.5707963267948966\n", + "RX target : [1] parameter : -1.5707963267948966\n", + "RX target : [0] parameter : -1.5707963267948966\n", + "RX target : [0] parameter : 1.5707963267948966\n", + "H target : [1] \n", + "RX target : [2] parameter : 1.5707963267948966\n", + "RX target : [3] parameter : 1.5707963267948966\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 12.548208534057895\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "RX target : [3] parameter : -1.5707963267948966\n", + "RX target : [2] parameter : -1.5707963267948966\n", + "H target : [1] \n", + "RX target : [0] parameter : -1.5707963267948966\n", + "H target : [0] \n", + "H target : [1] \n", + "RX target : [2] parameter : 1.5707963267948966\n", + "H target : [3] \n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 12.548208534057895\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "H target : [3] \n", + "RX target : [2] parameter : -1.5707963267948966\n", + "H target : [1] \n", + "H target : [0] \n", + "H target : [0] \n", + "RX target : [1] parameter : 1.5707963267948966\n", + "RX target : [2] parameter : 1.5707963267948966\n", + "RX target : [3] parameter : 1.5707963267948966\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 12.548208534057895\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "RX target : [3] parameter : -1.5707963267948966\n", + "RX target : [2] parameter : -1.5707963267948966\n", + "RX target : [1] parameter : -1.5707963267948966\n", + "H target : [0] \n", + "RX target : [0] parameter : 1.5707963267948966\n", + "H target : [1] \n", + "H target : [2] \n", + "H target : [3] \n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 0.018162080301277125\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "H target : [3] \n", + "H target : [2] \n", + "H target : [1] \n", + "RX target : [0] parameter : -1.5707963267948966\n", + "RX target : [0] parameter : 1.5707963267948966\n", + "RX target : [1] parameter : 1.5707963267948966\n", + "H target : [2] \n", + "RX target : [3] parameter : 1.5707963267948966\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 0.018162080301277125\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "RX target : [3] parameter : -1.5707963267948966\n", + "H target : [2] \n", + "RX target : [1] parameter : -1.5707963267948966\n", + "RX target : [0] parameter : -1.5707963267948966\n", + "H target : [0] \n", + "RX target : [1] parameter : 1.5707963267948966\n", + "H target : [2] \n", + "H target : [3] \n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 0.018162080301277125\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "H target : [3] \n", + "H target : [2] \n", + "RX target : [1] parameter : -1.5707963267948966\n", + "H target : [0] \n", + "H target : [0] \n", + "H target : [1] \n", + "H target : [2] \n", + "RX target : [3] parameter : 1.5707963267948966\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [3] control : [2] \n", + "RZ target : [3] parameter : 12.548208534057895\t (variational)\n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "CNOT target : [1] control : [0] \n", + "RX target : [3] parameter : -1.5707963267948966\n", + "H target : [2] \n", + "H target : [1] \n", + "H target : [0] \n", "\n" ] } @@ -441,21 +477,16 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.1372704157729\n", - " Iterations: 3\n", - " Function evaluations: 13\n", - " Gradient evaluations: 3\n", "\n", - "Optimal energy: \t -1.1372704157729\n", - "Optimal parameters: \t [-5.44125522e-05 5.65221900e-02]\n" + "Optimal energy: \t -1.1372704157729143\n", + "Optimal parameters: \t [-5.4412497e-05 5.6522190e-02]\n" ] } ], @@ -476,16 +507,16 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "FCI energy: \t -1.1372704220924401\n", - "CCSD energy: \t -1.1372704220946788\n", - "VQE energy: \t -1.1372704157729\n" + "FCI energy: \t -1.1372704220924397\n", + "CCSD energy: \t -1.1372704220914702\n", + "VQE energy: \t -1.1372704157729143\n" ] } ], @@ -520,7 +551,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -528,9 +559,8 @@ "output_type": "stream", "text": [ "-0.3369215 (params = [1. 1.])\n", - "converged SCF energy = -1.11668563039948\n", - "-1.1346304 (params = [2e-05, 0.036324160602554285])\n", - "-1.1372704 (params = [-5.44125522e-05 5.65221900e-02])\n" + "-1.1346304 (params = [2e-05, 0.03632416060255425])\n", + "-1.1372704 (params = [-5.4412497e-05 5.6522190e-02])\n" ] } ], @@ -566,7 +596,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -595,7 +625,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -627,7 +657,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -639,21 +669,15 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "converged SCF energy = -1.78948325185599\n", - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.8943598012230212\n", - " Iterations: 4\n", - " Function evaluations: 16\n", - " Gradient evaluations: 4\n", - "VQE energy: \t -1.8943598012230212\n", - "CCSD energy: \t -1.8943602376644733\n", + "VQE energy: \t -1.8943598012228877\n", + "CCSD energy: \t -1.894360237665742\n", "\n", " {'qubit_hamiltonian_terms': 15, 'circuit_width': 4, 'circuit_gates': 158, 'circuit_2qubit_gates': 64, 'circuit_var_gates': 12, 'vqe_variational_parameters': 2}\n" ] @@ -683,20 +707,14 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "converged SCF energy = -1.78948325185599\n", - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.9778373031817014\n", - " Iterations: 9\n", - " Function evaluations: 154\n", - " Gradient evaluations: 9\n", - "VQE energy: \t -1.9778373031817014\n", + "VQE energy: \t -1.9778372805046642\n", "\n", " {'qubit_hamiltonian_terms': 185, 'circuit_width': 8, 'circuit_gates': 2692, 'circuit_2qubit_gates': 1312, 'circuit_var_gates': 160, 'vqe_variational_parameters': 14}\n" ] @@ -731,39 +749,21 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "converged SCF energy = -1.11668563039948\n", - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.1372704157729\n", - " Iterations: 3\n", - " Function evaluations: 13\n", - " Gradient evaluations: 3\n", "\n", " {'qubit_hamiltonian_terms': 15, 'circuit_width': 4, 'circuit_gates': 158, 'circuit_2qubit_gates': 64, 'circuit_var_gates': 12, 'vqe_variational_parameters': 2} \n", "\n", - "converged SCF energy = -1.11668563039948\n", - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.1372704143406926\n", - " Iterations: 3\n", - " Function evaluations: 13\n", - " Gradient evaluations: 3\n", "\n", " {'qubit_hamiltonian_terms': 15, 'circuit_width': 4, 'circuit_gates': 107, 'circuit_2qubit_gates': 46, 'circuit_var_gates': 12, 'vqe_variational_parameters': 2} \n", "\n", - "converged SCF energy = -1.11668563039948\n", - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.1372702304939277\n", - " Iterations: 5\n", - " Function evaluations: 23\n", - " Gradient evaluations: 5\n", "\n", - " {'qubit_hamiltonian_terms': 5, 'circuit_width': 2, 'circuit_gates': 20, 'circuit_2qubit_gates': 4, 'circuit_var_gates': 4, 'vqe_variational_parameters': 2} \n", + " {'qubit_hamiltonian_terms': 5, 'circuit_width': 2, 'circuit_gates': 22, 'circuit_2qubit_gates': 4, 'circuit_var_gates': 4, 'vqe_variational_parameters': 2} \n", "\n" ] }, @@ -771,7 +771,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/media/sf_QEMIST_Tangelo/tangelo/tangelo/toolboxes/qubit_mappings/statevector_mapping.py:53: RuntimeWarning: Symmetry-conserving Bravyi-Kitaev enforces all spin-up followed by all spin-down ordering.\n", + "/home/alex/Codes/Tangelo/tangelo/toolboxes/qubit_mappings/statevector_mapping.py:149: RuntimeWarning: Symmetry-conserving Bravyi-Kitaev enforces all spin-up followed by all spin-down ordering.\n", " warnings.warn(\"Symmetry-conserving Bravyi-Kitaev enforces all spin-up followed by all spin-down ordering.\", RuntimeWarning)\n" ] } @@ -799,26 +799,16 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.137270337835849\n", - " Iterations: 3\n", - " Function evaluations: 9\n", - " Gradient evaluations: 3\n", "\n", " {'qubit_hamiltonian_terms': 15, 'circuit_width': 4, 'circuit_gates': 17, 'circuit_2qubit_gates': 6, 'circuit_var_gates': 1, 'vqe_variational_parameters': 1} \n", "\n", - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.13727033783102\n", - " Iterations: 3\n", - " Function evaluations: 15\n", - " Gradient evaluations: 3\n", "\n", " {'qubit_hamiltonian_terms': 15, 'circuit_width': 4, 'circuit_gates': 23, 'circuit_2qubit_gates': 8, 'circuit_var_gates': 3, 'vqe_variational_parameters': 3} \n", "\n" @@ -851,16 +841,21 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\tOptimal UCCSD energy: -1.1372703637657735\n", - "\tOptimal UCCSD variational parameters: [1.57091875 2.4126589 ]\n", - "\tNumber of Function Evaluations : 39\n" + "\tOptimal UCCSD energy: -1.1372704174429256\n", + " Normal return from subroutine COBYLA\n", + "\n", + " NFVALS = 36 F =-1.137270E+00 MAXCV = 0.000000E+00\n", + " X = 1.570763E+00 2.412707E+00\n", + "\n", + "\tOptimal UCCSD variational parameters: [1.57076299 2.41270658]\n", + "\tNumber of Function Evaluations : 36\n" ] } ], @@ -898,7 +893,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": { "scrolled": true }, @@ -907,28 +902,12 @@ "name": "stdout", "output_type": "stream", "text": [ - "converged SCF energy = -1.11668563039948\n", - "\tEnergy = -1.1346304 \n", - "\tEnergy = -1.1346304 \n", - "\tEnergy = -1.1346304 \n", - "\tEnergy = -1.1346330 \n", - "\tEnergy = -0.7901071 \n", - "\tEnergy = -1.1370452 \n", - "\tEnergy = -1.1370452 \n", - "\tEnergy = -1.1370452 \n", - "\tEnergy = -1.1370444 \n", - "\tEnergy = -1.1372704 \n", - "\tEnergy = -1.1372704 \n", - "\tEnergy = -1.1372704 \n", - "\tEnergy = -1.1372704 \n", - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.1372704157729283\n", - " Iterations: 3\n", - " Function evaluations: 13\n", - " Gradient evaluations: 3\n", - "\t\tOptimal VQE energy: None\n", - "\t\tOptimal VQE variational parameters: None\n", - "\t\tNumber of Function Evaluations : 13\n" + "VQESolver optimization results:\n", + "\tOptimal VQE energy: -1.1372704157729134\n", + "\tOptimal VQE variational parameters: [-5.44125627e-05 5.65221900e-02]\n", + "\tNumber of Iterations : 3\n", + "\tNumber of Function Evaluations : 10\n", + "\tNumber of Gradient Evaluations : 3\n" ] } ], @@ -960,17 +939,16 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "converged SCF energy = -1.11668563039948\n", - "Energy estimation with 1.0E+02 shots = -1.1562184233964925 \t(Error: 1.89E-02)\n", - "Energy estimation with 1.0E+04 shots = -1.1363766310347638 \t(Error: 8.94E-04)\n", - "Energy estimation with 1.0E+06 shots = -1.1374247256596115 \t(Error: 1.54E-04)\n" + "Energy estimation with 1.0E+02 shots = -1.1335574814374392 \t(Error: 3.71E-03)\n", + "Energy estimation with 1.0E+04 shots = -1.1358696314459025 \t(Error: 1.40E-03)\n", + "Energy estimation with 1.0E+06 shots = -1.1372051734252862 \t(Error: 6.52E-05)\n" ] } ], @@ -1003,9 +981,9 @@ ], "metadata": { "kernelspec": { - "display_name": "tangelo_docs_aesthetics", + "display_name": "qsdk", "language": "python", - "name": "tangelo_docs_aesthetics" + "name": "qsdk" }, "language_info": { "codemirror_mode": { @@ -1017,7 +995,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.9.9" } }, "nbformat": 4, diff --git a/examples/vqe_custom_ansatz_hamiltonian.ipynb b/examples/vqe_custom_ansatz_hamiltonian.ipynb index b9679ab8b..a03615f00 100755 --- a/examples/vqe_custom_ansatz_hamiltonian.ipynb +++ b/examples/vqe_custom_ansatz_hamiltonian.ipynb @@ -15,6 +15,12 @@ "metadata": {}, "outputs": [], "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install tangelo-gc --quiet\n", + "\n", "import numpy as np\n", "\n", "from tangelo.algorithms import VQESolver, FCISolver\n", @@ -286,29 +292,18 @@ "execution_count": 10, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.137233584498153\n", - " Iterations: 45\n", - " Function evaluations: 2791\n", - " Gradient evaluations: 45\n" - ] - }, { "name": "stderr", "output_type": "stream", "text": [ - ":25: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n", + "/tmp/ipykernel_46116/549362070.py:25: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n", " elif var_params == \"ones\":\n" ] }, { "data": { "text/plain": [ - "-1.137233584498153" + "-1.1372335845006827" ] }, "execution_count": 10, @@ -359,21 +354,21 @@ "name": "stdout", "output_type": "stream", "text": [ - "(-0.09883484730799698+0j) [] +\n", - "(-0.045321883918106314+0j) [X0 X1 Y2 Y3] +\n", - "(0.045321883918106314+0j) [X0 Y1 Y2 X3] +\n", - "(0.045321883918106314+0j) [Y0 X1 X2 Y3] +\n", - "(-0.045321883918106314+0j) [Y0 Y1 X2 X3] +\n", - "(0.1712012380659591+0j) [Z0] +\n", - "(0.16862327595071594+0j) [Z0 Z1] +\n", - "(0.12054612740556855+0j) [Z0 Z2] +\n", - "(0.16586801132367487+0j) [Z0 Z3] +\n", - "(0.17120123806595905+0j) [Z1] +\n", - "(0.16586801132367487+0j) [Z1 Z2] +\n", - "(0.12054612740556855+0j) [Z1 Z3] +\n", - "(-0.22279639651093158+0j) [Z2] +\n", - "(0.1743494875700707+0j) [Z2 Z3] +\n", - "(-0.22279639651093153+0j) [Z3]\n" + "(-0.09883484730799569+0j) [] +\n", + "(-0.045321883918106265+0j) [X0 X1 Y2 Y3] +\n", + "(0.045321883918106265+0j) [X0 Y1 Y2 X3] +\n", + "(0.045321883918106265+0j) [Y0 X1 X2 Y3] +\n", + "(-0.045321883918106265+0j) [Y0 Y1 X2 X3] +\n", + "(0.17120123806595938+0j) [Z0] +\n", + "(0.16862327595071586+0j) [Z0 Z1] +\n", + "(0.12054612740556847+0j) [Z0 Z2] +\n", + "(0.16586801132367474+0j) [Z0 Z3] +\n", + "(0.1712012380659594+0j) [Z1] +\n", + "(0.16586801132367474+0j) [Z1 Z2] +\n", + "(0.12054612740556847+0j) [Z1 Z3] +\n", + "(-0.22279639651093203+0j) [Z2] +\n", + "(0.17434948757007068+0j) [Z2 Z3] +\n", + "(-0.22279639651093203+0j) [Z3]\n" ] } ], @@ -397,29 +392,18 @@ "execution_count": 12, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.137233584498153\n", - " Iterations: 45\n", - " Function evaluations: 2791\n", - " Gradient evaluations: 45\n" - ] - }, { "name": "stderr", "output_type": "stream", "text": [ - ":25: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n", + "/tmp/ipykernel_46116/549362070.py:25: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n", " elif var_params == \"ones\":\n" ] }, { "data": { "text/plain": [ - "-1.137233584498153" + "-1.1372335845006827" ] }, "execution_count": 12, @@ -489,80 +473,80 @@ "text": [ "Circuit object. Size 74 \n", "\n", - "X target : 0 \n", - "X target : 1 \n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RX target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RX target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RX target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "RX target : 3 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RX target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RX target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RX target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "RX target : 3 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RX target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RX target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RX target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "RX target : 3 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RX target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RX target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RX target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "RX target : 3 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "CNOT target : 1 control : 0 \n", - "CNOT target : 3 control : 2 \n", - "CNOT target : 2 control : 1 \n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RX target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 0 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RX target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 1 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RX target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 2 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", - "RX target : 3 parameter : 0.0\t (variational)\n", - "RZ target : 3 parameter : 0.0\t (variational)\n", + "X target : [0] \n", + "X target : [1] \n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RX target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RX target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RX target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "RX target : [3] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RX target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RX target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RX target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "RX target : [3] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RX target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RX target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RX target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "RX target : [3] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RX target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RX target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RX target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "RX target : [3] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "CNOT target : [1] control : [0] \n", + "CNOT target : [3] control : [2] \n", + "CNOT target : [2] control : [1] \n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RX target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [0] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RX target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [1] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RX target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [2] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", + "RX target : [3] parameter : 0.0\t (variational)\n", + "RZ target : [3] parameter : 0.0\t (variational)\n", "\n" ] } @@ -584,21 +568,10 @@ "execution_count": 15, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Optimization terminated successfully. (Exit mode 0)\n", - " Current function value: -1.1371714690876744\n", - " Iterations: 49\n", - " Function evaluations: 3039\n", - " Gradient evaluations: 49\n" - ] - }, { "data": { "text/plain": [ - "-1.1371714690876744" + "-1.1370682042984708" ] }, "execution_count": 15, @@ -630,7 +603,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "HEA-VQE ENERGY (from a circuit): -1.1371715 Ha\n" + "HEA-VQE ENERGY (from a circuit): -1.1370682 Ha\n" ] } ], @@ -651,9 +624,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Tangelo", + "display_name": "qsdk", "language": "python", - "name": "tangelo" + "name": "qsdk" }, "language_info": { "codemirror_mode": { @@ -665,7 +638,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.0" + "version": "3.9.9" } }, "nbformat": 4, From 83901fe7e3d2a1b1493536c934340398b9f6f3bc Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Wed, 10 Aug 2022 15:40:32 -0400 Subject: [PATCH 04/35] Primitive examples/README. --- examples/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 examples/README.md diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 000000000..908f3af95 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,10 @@ +# Tangelo Examples + +| Notebook | GColab link | +|----------|-------------| +| VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe.ipynb | +| Custom VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe_custom_ansatz_hamiltonian.ipynb | +| ADAPT-VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/adapt.ipynb | +| DMET | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/dmet.ipynb | +| ONIOM | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/oniom.ipynb | +| Classical Shadows | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/classical_shadows.ipynb | From 6814a2d55d32c0a9bfff41315b65cfed549aa52a Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Thu, 11 Aug 2022 09:31:59 -0400 Subject: [PATCH 05/35] Revert "WIP." This reverts commit 5bf31b5ff6d3e9a5587e9a4e8ec144de48b76937. --- .../toolboxes/qubit_mappings/combinatorial.py | 95 ++++++++++++------- 1 file changed, 60 insertions(+), 35 deletions(-) diff --git a/tangelo/toolboxes/qubit_mappings/combinatorial.py b/tangelo/toolboxes/qubit_mappings/combinatorial.py index 9f96a8323..ef6394e0d 100644 --- a/tangelo/toolboxes/qubit_mappings/combinatorial.py +++ b/tangelo/toolboxes/qubit_mappings/combinatorial.py @@ -18,7 +18,6 @@ import itertools from collections import OrderedDict from math import ceil -from copy import deepcopy from openfermion import chemist_ordered from openfermion.linalg import qubit_operator_sparse, get_sparse_operator @@ -85,35 +84,28 @@ def get_sigmam(bistring): return sigma, M -def op_on_sigma(ops, sigma_in): +def op_on_sigma(ops, sigma): """ Eq. (20) without the (-1)^p term.""" assert len(ops) == 2, f"{ops}" - sigma = deepcopy(sigma_in) sigma = list(sigma) for i_qubit, creation_op in reversed(ops): # If it is a^{\dagger} (creation operator) if creation_op: if i_qubit not in sigma: + sigma = [*sigma, i_qubit] - i = i_qubit else: - return 0, 0 + return 0 else: if i_qubit in sigma: sigma.remove(i_qubit) - j = i_qubit else: - return 0, 0 - - if i in sigma_in: - p = i - elif j in sigma_in: - p = j + return 0 - return tuple(sorted(sigma)), (-1)**p + return tuple(sorted(sigma)) def compact_hamiltonian(H_ferm, n_modes, n_electrons, h1, h2): @@ -145,57 +137,94 @@ def compact_hamiltonian(H_ferm, n_modes, n_electrons, h1, h2): basis_set = OrderedDict() for sigma_alpha, int_alpha in basis_set_alpha.items(): for sigma_beta, int_beta in basis_set_beta.items(): - # Alternate ordering (like FermionOperator) sigma = tuple(sorted([2*sa for sa in sigma_alpha] + [2*sb+1 for sb in sigma_beta])) - unique_int = (int_alpha * n_choose_alpha) + int_beta + unique_int = (int_alpha*n_choose_alpha)+int_beta basis_set[sigma] = unique_int - print(basis_set) + #print(basis_set) # H_1 and H_2 initialization to 2^n * 2^n matrices. h_one = np.zeros((2**n, 2**n)) h_two = np.zeros((2**n, 2**n)) + """ + for op, _ in H_ferm.terms.items(): + for sigma_pp, unique_int in basis_set.items(): + + # 1-body terms. + if len(op) == 2: + i, j = op[0][0], op[1][0] + + sigma_qq = op_on_sigma(op, sigma_pp) + + if sigma_qq in basis_set.keys(): + int_p = basis_set[sigma_pp] + int_q = basis_set[sigma_qq] + + h_one[int_p, int_q] += h1[i][j] + h_one[int_q, int_p] += h1[j][i].conj() + + # 2-body terms. + elif len(op) == 4: + i, j, k, l = op[0][0], op[1][0], op[2][0], op[3][0] + + sigma_qq = op_on_sigma(op[:2], sigma_pp) + + if sigma_qq in basis_set.keys(): + sigma_tt = op_on_sigma(op[2:], sigma_qq) + + if sigma_tt in basis_set.keys(): + int_p = basis_set[sigma_pp] + int_t = basis_set[sigma_tt] + + h_two[int_p, int_t] += h2[i][j][k][l] + h_two[int_t, int_p] += h2[k][l][i][j].conj() + + j, k = op[1][0], op[2][0] + if j == k: + raise ValueError + """ + for sigma_pp, unique_int in basis_set.items(): # 1-body terms. for i, j in itertools.product(range(2*n_modes), repeat=2): op = ((i, 1), (j, 0)) - sigma_qq, phase_qq = op_on_sigma(op, sigma_pp) + sigma_qq = op_on_sigma(op, sigma_pp) if sigma_qq in basis_set.keys(): int_p = basis_set[sigma_pp] int_q = basis_set[sigma_qq] - h_one[int_p][int_q] += h1[i][j]# * phase_qq - h_one[int_q][int_p] += h1[j][i].conj()# * phase_qq + h_one[int_p, int_q] += h1[i][j] + h_one[int_q, int_p] += h1[j][i].conj() #for sigma_pp, unique_int in basis_set.items(): # 2-body terms. for i, j, k, l in itertools.product(range(2*n_modes), repeat=4): op = ((i, 1), (j, 0), (k, 1), (l, 0)) - sigma_qq, phase_qq = op_on_sigma(op[:2], sigma_pp) + sigma_qq = op_on_sigma(op[:2], sigma_pp) if sigma_qq in basis_set.keys(): - sigma_tt, phase_tt = op_on_sigma(op[2:], sigma_qq) + sigma_tt = op_on_sigma(op[2:], sigma_qq) if sigma_tt in basis_set.keys(): int_p = basis_set[sigma_pp] int_t = basis_set[sigma_tt] - h_two[int_p][int_t] += h2[i][j][k][l]# * phase_tt * phase_qq - h_two[int_t][int_p] += h2[k][l][i][j].conj()# * phase_tt * phase_qq + h_two[int_p, int_t] += h2[i][j][k][l] + h_two[int_t, int_p] += h2[k][l][i][j].conj() if k == j: - op_il = (op[0], op[-1]) - sigma_qq, phase_qq = op_on_sigma(op_il, sigma_pp) + op_il = (op[0], op[-1]) + sigma_qq = op_on_sigma(op_il, sigma_pp) if sigma_qq in basis_set.keys(): int_q = basis_set[sigma_qq] int_p = basis_set[sigma_pp] - h_two[int_p][int_q] -= h2[i][j][k][l]# * phase_qq - h_two[int_q][int_p] -= h2[k][l][i][j].conj()# * phase_qq + h_two[int_p, int_q] -= h2[i][j][k][l] + h_two[int_q, int_p] -= h2[k][l][i][j].conj() # Return the compact Hamiltonian H_c return h_one + h_two # + H_ferm.constant @@ -225,27 +254,23 @@ def h_to_qubitop(h_c, n): from tangelo.molecule_library import mol_H2_sto3g, mol_H4_sto3g mol = mol_H2_sto3g - H_ferm = mol.fermionic_hamiltonian H_ferm = chemist_ordered(mol.fermionic_hamiltonian) true_eigs = eigenspectrum(H_ferm) print(true_eigs) core_constant, one_body_integrals, two_body_integrals = mol.get_active_space_integrals() one_body_coefficients, two_body_coefficients = spinorb_from_spatial(one_body_integrals, two_body_integrals) - #two_body_coefficients *= 0.5 - - #print(two_body_integrals) - #print(two_body_coefficients) H = compact_hamiltonian(H_ferm, mol.n_active_mos, mol.n_active_electrons, one_body_coefficients, two_body_coefficients) + #norm_factor = np.trace(H.conj().T @ H) + #H /= np.sqrt(norm_factor) + #H *= 2 eigs, eigvs = np.linalg.eigh(H) print(eigs) - #print(H) + #print(eigvs) #Hq = h_to_qubitop(H, 2) #print(Hq) #matrix = qubit_operator_sparse(Hq).todense() #eigs, eigvs = np.linalg.eigh(matrix) #print(eigs) - - #print(op_on_sigma(((3, 1), (3, 0)), (1, 3))) From ceb430fc71280741a82b89f6725e74773f79a315 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Thu, 11 Aug 2022 09:32:36 -0400 Subject: [PATCH 06/35] Revert "Code completed, but wrong eigenvalues." This reverts commit 9feb78233dbf4d78c6409597809dfe54f93a6dd5. --- .../toolboxes/qubit_mappings/combinatorial.py | 276 ------------------ 1 file changed, 276 deletions(-) delete mode 100644 tangelo/toolboxes/qubit_mappings/combinatorial.py diff --git a/tangelo/toolboxes/qubit_mappings/combinatorial.py b/tangelo/toolboxes/qubit_mappings/combinatorial.py deleted file mode 100644 index ef6394e0d..000000000 --- a/tangelo/toolboxes/qubit_mappings/combinatorial.py +++ /dev/null @@ -1,276 +0,0 @@ -# Copyright 2021 Good Chemistry Company. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""TODO -""" - -import itertools -from collections import OrderedDict -from math import ceil - -from openfermion import chemist_ordered -from openfermion.linalg import qubit_operator_sparse, get_sparse_operator -import numpy as np -from scipy.special import comb - -from tangelo.linq.helpers.circuits.measurement_basis import pauli_string_to_of -from tangelo.toolboxes.operators import QubitOperator, FermionOperator - - -def f(sigma, M): - """TODO - - Args: - - Returns: - - """ - N = len(sigma) - - terms_k = [comb(M-sigma[N-1-k]-1, k+1) for k in range(N)] - unique_int = comb(M, N) - 1 - np.sum(terms_k) - - if not unique_int.is_integer(): - raise ValueError - return int(unique_int) - -def basis(M, N): - """TODO - - Args: - - Returns: - - """ - mapping = [(sigma, f(sigma, M)) for sigma in itertools.combinations(range(M), N)] - return OrderedDict(mapping) - -def get_bitstring(sigma, M): - """TODO - - Args: - - Returns: - - """ - - bitstring = np.zeros(M) - np.put(bitstring, ind=sigma, v=1) - - return bitstring - -def get_sigmam(bistring): - """TODO - - Args: - - Returns: - - """ - - sigma = tuple(np.where(bistring == 1)[0]) - M = len(bistring) - - return sigma, M - -def op_on_sigma(ops, sigma): - """ Eq. (20) without the (-1)^p term.""" - - assert len(ops) == 2, f"{ops}" - - sigma = list(sigma) - - for i_qubit, creation_op in reversed(ops): - # If it is a^{\dagger} (creation operator) - if creation_op: - if i_qubit not in sigma: - - sigma = [*sigma, i_qubit] - else: - return 0 - else: - if i_qubit in sigma: - sigma.remove(i_qubit) - else: - return 0 - - return tuple(sorted(sigma)) - - -def compact_hamiltonian(H_ferm, n_modes, n_electrons, h1, h2): - """TODO - up_then_down must be set to False for now. - - Args: - - Returns: - - """ - - #assert H_ferm.is_normal_ordered() - #H_ferm = chemist_ordered(H_ferm) - #print(H_ferm.constant) - - if isinstance(n_electrons, tuple) and len(n_electrons) == 2: - n_alpha, n_beta = n_electrons - elif isinstance(n_electrons, int) and n_electrons % 2 == 0: - n_alpha = n_beta = n_electrons // 2 - else: - raise ValueError - - n_choose_alpha = comb(n_modes, n_alpha, exact=True) - n = ceil(np.log2(n_choose_alpha * comb(n_modes, n_beta, exact=True))) - - basis_set_alpha = basis(n_modes, n_alpha) - basis_set_beta = basis(n_modes, n_beta) - basis_set = OrderedDict() - for sigma_alpha, int_alpha in basis_set_alpha.items(): - for sigma_beta, int_beta in basis_set_beta.items(): - sigma = tuple(sorted([2*sa for sa in sigma_alpha] + [2*sb+1 for sb in sigma_beta])) - unique_int = (int_alpha*n_choose_alpha)+int_beta - basis_set[sigma] = unique_int - - #print(basis_set) - - # H_1 and H_2 initialization to 2^n * 2^n matrices. - h_one = np.zeros((2**n, 2**n)) - h_two = np.zeros((2**n, 2**n)) - - """ - for op, _ in H_ferm.terms.items(): - for sigma_pp, unique_int in basis_set.items(): - - # 1-body terms. - if len(op) == 2: - i, j = op[0][0], op[1][0] - - sigma_qq = op_on_sigma(op, sigma_pp) - - if sigma_qq in basis_set.keys(): - int_p = basis_set[sigma_pp] - int_q = basis_set[sigma_qq] - - h_one[int_p, int_q] += h1[i][j] - h_one[int_q, int_p] += h1[j][i].conj() - - # 2-body terms. - elif len(op) == 4: - i, j, k, l = op[0][0], op[1][0], op[2][0], op[3][0] - - sigma_qq = op_on_sigma(op[:2], sigma_pp) - - if sigma_qq in basis_set.keys(): - sigma_tt = op_on_sigma(op[2:], sigma_qq) - - if sigma_tt in basis_set.keys(): - int_p = basis_set[sigma_pp] - int_t = basis_set[sigma_tt] - - h_two[int_p, int_t] += h2[i][j][k][l] - h_two[int_t, int_p] += h2[k][l][i][j].conj() - - j, k = op[1][0], op[2][0] - if j == k: - raise ValueError - """ - - for sigma_pp, unique_int in basis_set.items(): - - # 1-body terms. - for i, j in itertools.product(range(2*n_modes), repeat=2): - op = ((i, 1), (j, 0)) - sigma_qq = op_on_sigma(op, sigma_pp) - - if sigma_qq in basis_set.keys(): - int_p = basis_set[sigma_pp] - int_q = basis_set[sigma_qq] - - h_one[int_p, int_q] += h1[i][j] - h_one[int_q, int_p] += h1[j][i].conj() - - #for sigma_pp, unique_int in basis_set.items(): - # 2-body terms. - for i, j, k, l in itertools.product(range(2*n_modes), repeat=4): - op = ((i, 1), (j, 0), (k, 1), (l, 0)) - sigma_qq = op_on_sigma(op[:2], sigma_pp) - - if sigma_qq in basis_set.keys(): - sigma_tt = op_on_sigma(op[2:], sigma_qq) - - if sigma_tt in basis_set.keys(): - int_p = basis_set[sigma_pp] - int_t = basis_set[sigma_tt] - - h_two[int_p, int_t] += h2[i][j][k][l] - h_two[int_t, int_p] += h2[k][l][i][j].conj() - - if k == j: - op_il = (op[0], op[-1]) - sigma_qq = op_on_sigma(op_il, sigma_pp) - - if sigma_qq in basis_set.keys(): - int_q = basis_set[sigma_qq] - int_p = basis_set[sigma_pp] - - h_two[int_p, int_q] -= h2[i][j][k][l] - h_two[int_q, int_p] -= h2[k][l][i][j].conj() - - # Return the compact Hamiltonian H_c - return h_one + h_two # + H_ferm.constant - -def h_to_qubitop(h_c, n): - - qu_op = QubitOperator() - - for pauli_tensor in itertools.product("IXYZ", repeat=n): - pauli_word = "".join(pauli_tensor) - term = pauli_string_to_of(pauli_word) - - term_op = QubitOperator(term, 1.) - - c_j = np.trace(h_c.conj().T @ qubit_operator_sparse(term_op, n_qubits=n).todense()) - qu_op += QubitOperator(term, c_j) - - qu_op *= 1 / np.sqrt(2**n) * 0.5 # Why the 0.5 factor!!! - qu_op.compress() - return qu_op - - -if __name__ == "__main__": - - from openfermion.linalg import eigenspectrum - from openfermion.chem.molecular_data import spinorb_from_spatial - from tangelo.molecule_library import mol_H2_sto3g, mol_H4_sto3g - mol = mol_H2_sto3g - - H_ferm = chemist_ordered(mol.fermionic_hamiltonian) - true_eigs = eigenspectrum(H_ferm) - print(true_eigs) - - core_constant, one_body_integrals, two_body_integrals = mol.get_active_space_integrals() - one_body_coefficients, two_body_coefficients = spinorb_from_spatial(one_body_integrals, two_body_integrals) - - H = compact_hamiltonian(H_ferm, mol.n_active_mos, mol.n_active_electrons, one_body_coefficients, two_body_coefficients) - #norm_factor = np.trace(H.conj().T @ H) - #H /= np.sqrt(norm_factor) - #H *= 2 - eigs, eigvs = np.linalg.eigh(H) - print(eigs) - #print(eigvs) - - #Hq = h_to_qubitop(H, 2) - #print(Hq) - #matrix = qubit_operator_sparse(Hq).todense() - #eigs, eigvs = np.linalg.eigh(matrix) - #print(eigs) From b77b4e1cb8ab43a2c5142a2e924a1e332a67abd6 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Thu, 11 Aug 2022 09:36:24 -0400 Subject: [PATCH 07/35] Revert changes on MIFNO notebook. --- examples/mifno.ipynb | 152 +++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 85 deletions(-) diff --git a/examples/mifno.ipynb b/examples/mifno.ipynb index e67319a0c..6bacf8ed4 100644 --- a/examples/mifno.ipynb +++ b/examples/mifno.ipynb @@ -10,26 +10,8 @@ "\n", "You do not need to have the `qemist-client` python package installed to run this notebook: only `tangelo` is required. For more information about [QEMIST Cloud](https://goodchemistry.com/qemist-cloud/) (installation, features, issues, `qemist_client` API...), please refer to the [QEMIST Cloud documentation](https://alpha-api.qemist.cloud/#/docs) or contact their development team.\n", "\n", - "The first section provides a high-level description of the MI-FNO approach. The second one briefly shows how QEMIST Cloud can apply this approach to a usecase, and provide reference results computed with high-accuracy classical solvers. We then focus on the API provided in Tangelo allowing users to combine the MI-FNO performed by QEMIST Cloud and any quantum workflow written with Tangelo." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "# Installation of tangelo if not already installed.\n", - "try:\n", - " import tangelo\n", - "except ModuleNotFoundError:\n", - " !pip install tangelo-gc --quiet" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ + "The first section provides a high-level description of the MI-FNO approach. The second one briefly shows how QEMIST Cloud can apply this approach to a usecase, and provide reference results computed with high-accuracy classical solvers. We then focus on the API provided in Tangelo allowing users to combine the MI-FNO performed by QEMIST Cloud and any quantum workflow written with Tangelo.\n", + "\n", "## Use case\n", "\n", "Our use case here is the hydrogen fluoride (HF) system defined below, using the `sto-3g` basis, chosen for simplicity. However, the MI-FNO method can be used to tackle much larger systems." @@ -37,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -186,7 +168,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -202,7 +184,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -213,35 +195,35 @@ "Total MI-FNO energy = -98.59655271223816\n", "Correlation energy = -0.025795120623911316\n", "Mean-field energy = -98.57075759161424\n", - " problem_handle epsilon energy_correlation energy_total \\\n", - "(1,) 65652562505002413 -0.001326 -0.001326 -98.572083 \n", - "(2,) 10837505518890413 -0.019846 -0.019846 -98.590604 \n", - "(3,) 31462118862908845 -0.000862 -0.000862 -98.571619 \n", - "(4,) 49501973643554221 -0.000756 -0.000756 -98.571513 \n", - "(1, 2) 65302015864237516 -0.003024 -0.024195 -98.594953 \n", - "(1, 3) 53405772498103756 0.000085 -0.002102 -98.572860 \n", - "(1, 4) 13411621153304012 0.000142 -0.001939 -98.572697 \n", - "(2, 3) 22700772126125516 -0.000845 -0.021553 -98.592310 \n", - "(2, 4) 27549614109650380 0.000124 -0.020477 -98.591235 \n", - "(3, 4) 23150438022147532 0.000078 -0.001540 -98.572297 \n", - "(1, 2, 3) 30910159730798073 0.000466 -0.025351 -98.596109 \n", - "(1, 2, 4) 13137250052500985 -0.000016 -0.024701 -98.595458 \n", - "(2, 3, 4) 17864205159132665 -0.000017 -0.022123 -98.592881 \n", + " problem_handle epsilon correction energy_total \\\n", + "(1,) 65652562505002413 -0.001326 0.0 -98.572083 \n", + "(2,) 10837505518890413 -0.019846 0.0 -98.590604 \n", + "(3,) 31462118862908845 -0.000862 0.0 -98.571619 \n", + "(4,) 49501973643554221 -0.000756 0.0 -98.571513 \n", + "(1, 2) 65302015864237516 -0.003024 0.0 -98.594953 \n", + "(1, 3) 53405772498103756 0.000085 0.0 -98.572860 \n", + "(1, 4) 13411621153304012 0.000142 0.0 -98.572697 \n", + "(2, 3) 22700772126125516 -0.000845 0.0 -98.592310 \n", + "(2, 4) 27549614109650380 0.000124 0.0 -98.591235 \n", + "(3, 4) 23150438022147532 0.000078 0.0 -98.572297 \n", + "(1, 2, 3) 30910159730798073 0.000466 0.0 -98.596109 \n", + "(1, 2, 4) 13137250052500985 -0.000016 0.0 -98.595458 \n", + "(2, 3, 4) 17864205159132665 -0.000017 0.0 -98.592881 \n", "\n", - " correction \n", - "(1,) 0.0 \n", - "(2,) 0.0 \n", - "(3,) 0.0 \n", - "(4,) 0.0 \n", - "(1, 2) 0.0 \n", - "(1, 3) 0.0 \n", - "(1, 4) 0.0 \n", - "(2, 3) 0.0 \n", - "(2, 4) 0.0 \n", - "(3, 4) 0.0 \n", - "(1, 2, 3) 0.0 \n", - "(1, 2, 4) 0.0 \n", - "(2, 3, 4) 0.0 \n" + " energy_correlation \n", + "(1,) -0.001326 \n", + "(2,) -0.019846 \n", + "(3,) -0.000862 \n", + "(4,) -0.000756 \n", + "(1, 2) -0.024195 \n", + "(1, 3) -0.002102 \n", + "(1, 4) -0.001939 \n", + "(2, 3) -0.021553 \n", + "(2, 4) -0.020477 \n", + "(3, 4) -0.001540 \n", + "(1, 2, 3) -0.025351 \n", + "(1, 2, 4) -0.024701 \n", + "(2, 3, 4) -0.022123 \n" ] } ], @@ -274,7 +256,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -294,7 +276,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -341,7 +323,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -350,43 +332,43 @@ "text": [ "Iteration 1 of QITE with starting energy -98.57075759161438\n", "Iteration 2 of QITE with starting energy -98.57113742411626\n", - "Iteration 3 of QITE with starting energy -98.57140787802679\n", - "Iteration 4 of QITE with starting energy -98.57160051301521\n", - "Iteration 5 of QITE with starting energy -98.57173778001223\n", - "Iteration 6 of QITE with starting energy -98.57183564774611\n", - "Iteration 7 of QITE with starting energy -98.5719054735955\n", - "Iteration 8 of QITE with starting energy -98.57195533528024\n", - "Iteration 9 of QITE with starting energy -98.57199097832189\n", - "Iteration 10 of QITE with starting energy -98.57201648991878\n", - "Iteration 11 of QITE with starting energy -98.57203477812958\n", - "Iteration 12 of QITE with starting energy -98.57204791256746\n", - "Iteration 13 of QITE with starting energy -98.57205736661125\n", - "Iteration 14 of QITE with starting energy -98.57206418959552\n", - "Iteration 15 of QITE with starting energy -98.57206912922344\n", - "Iteration 16 of QITE with starting energy -98.5720727185951\n", - "Iteration 17 of QITE with starting energy -98.57207533808469\n", - "Iteration 18 of QITE with starting energy -98.57207725934003\n", - "Iteration 19 of QITE with starting energy -98.57207867657328\n", - "Iteration 20 of QITE with starting energy -98.57207972881851\n", - "Iteration 21 of QITE with starting energy -98.57208051576744\n", - "Iteration 22 of QITE with starting energy -98.57208110903868\n", - "Iteration 23 of QITE with starting energy -98.57208156020101\n", - "Iteration 24 of QITE with starting energy -98.57208190648767\n", - "Iteration 25 of QITE with starting energy -98.5720821748677\n", - "Iteration 26 of QITE with starting energy -98.57208238495038\n", - "Iteration 27 of QITE with starting energy -98.5720825510557\n", - "Iteration 28 of QITE with starting energy -98.57208268369548\n", - "Iteration 29 of QITE with starting energy -98.57208279063067\n", - "Final energy of QITE is -98.57208287762965\n" + "Iteration 3 of QITE with starting energy -98.57140787803596\n", + "Iteration 4 of QITE with starting energy -98.57160051304942\n", + "Iteration 5 of QITE with starting energy -98.57173778008372\n", + "Iteration 6 of QITE with starting energy -98.57183564786015\n", + "Iteration 7 of QITE with starting energy -98.57190547375154\n", + "Iteration 8 of QITE with starting energy -98.57195533547332\n", + "Iteration 9 of QITE with starting energy -98.57199097854448\n", + "Iteration 10 of QITE with starting energy -98.57201649016257\n", + "Iteration 11 of QITE with starting energy -98.57203477838605\n", + "Iteration 12 of QITE with starting energy -98.57204791282895\n", + "Iteration 13 of QITE with starting energy -98.57205736687135\n", + "Iteration 14 of QITE with starting energy -98.57206418984897\n", + "Iteration 15 of QITE with starting energy -98.57206912946631\n", + "Iteration 16 of QITE with starting energy -98.57207271882451\n", + "Iteration 17 of QITE with starting energy -98.57207533829896\n", + "Iteration 18 of QITE with starting energy -98.5720772595381\n", + "Iteration 19 of QITE with starting energy -98.57207867675483\n", + "Iteration 20 of QITE with starting energy -98.57207972898374\n", + "Iteration 21 of QITE with starting energy -98.57208051591682\n", + "Iteration 22 of QITE with starting energy -98.57208110917304\n", + "Iteration 23 of QITE with starting energy -98.5720815603213\n", + "Iteration 24 of QITE with starting energy -98.5720819065949\n", + "Iteration 25 of QITE with starting energy -98.57208217496307\n", + "Iteration 26 of QITE with starting energy -98.57208238503476\n", + "Iteration 27 of QITE with starting energy -98.57208255113032\n", + "Iteration 28 of QITE with starting energy -98.5720826837612\n", + "Iteration 29 of QITE with starting energy -98.57208279068848\n", + "Final energy of QITE is -98.57208287768049\n" ] }, { "data": { "text/plain": [ - "-98.57208287762965" + "-98.57208287768049" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -419,7 +401,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { From 88fc37b6fb6533c0d870a18a4ce98caf7c60d2ce Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Thu, 11 Aug 2022 09:42:11 -0400 Subject: [PATCH 08/35] Change tangelo-gc to github. --- examples/adapt.ipynb | 2 +- examples/classical_shadows.ipynb | 2 +- examples/dmet.ipynb | 2 +- examples/oniom.ipynb | 2 +- examples/vqe.ipynb | 2 +- examples/vqe_custom_ansatz_hamiltonian.ipynb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/adapt.ipynb b/examples/adapt.ipynb index 8780a7776..e0975c0f3 100755 --- a/examples/adapt.ipynb +++ b/examples/adapt.ipynb @@ -24,7 +24,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install tangelo-gc --quiet" + " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet" ] }, { diff --git a/examples/classical_shadows.ipynb b/examples/classical_shadows.ipynb index 872edee31..1bb4d0c16 100644 --- a/examples/classical_shadows.ipynb +++ b/examples/classical_shadows.ipynb @@ -27,7 +27,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install tangelo-gc --quiet" + " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet" ] }, { diff --git a/examples/dmet.ipynb b/examples/dmet.ipynb index 74b2a9848..8b0070fa2 100755 --- a/examples/dmet.ipynb +++ b/examples/dmet.ipynb @@ -41,7 +41,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install tangelo-gc --quiet" + " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet" ] }, { diff --git a/examples/oniom.ipynb b/examples/oniom.ipynb index 552b756ed..95898e3c0 100755 --- a/examples/oniom.ipynb +++ b/examples/oniom.ipynb @@ -26,7 +26,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install tangelo-gc --quiet" + " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet" ] }, { diff --git a/examples/vqe.ipynb b/examples/vqe.ipynb index 678ed9416..506c95ceb 100755 --- a/examples/vqe.ipynb +++ b/examples/vqe.ipynb @@ -40,7 +40,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install tangelo-gc --quiet\n", + " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet\n", "\n", "# Installation of qulacs if not already installed.\n", "try:\n", diff --git a/examples/vqe_custom_ansatz_hamiltonian.ipynb b/examples/vqe_custom_ansatz_hamiltonian.ipynb index a03615f00..a0acd47a6 100755 --- a/examples/vqe_custom_ansatz_hamiltonian.ipynb +++ b/examples/vqe_custom_ansatz_hamiltonian.ipynb @@ -19,7 +19,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install tangelo-gc --quiet\n", + " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet\n", "\n", "import numpy as np\n", "\n", From 2bf225fd2b0b77f76b9fce072247ea8612d99d39 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Thu, 11 Aug 2022 09:43:54 -0400 Subject: [PATCH 09/35] Removed metadata. --- examples/adapt.ipynb | 4 +--- examples/oniom.ipynb | 12 +++--------- examples/vqe.ipynb | 4 +--- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/examples/adapt.ipynb b/examples/adapt.ipynb index e0975c0f3..7eb8e48e4 100755 --- a/examples/adapt.ipynb +++ b/examples/adapt.ipynb @@ -55,9 +55,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [ { "name": "stderr", diff --git a/examples/oniom.ipynb b/examples/oniom.ipynb index 95898e3c0..b2494eba6 100755 --- a/examples/oniom.ipynb +++ b/examples/oniom.ipynb @@ -99,9 +99,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [], "source": [ "# Coordinates file\n", @@ -185,9 +183,7 @@ { "cell_type": "code", "execution_count": 6, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -230,9 +226,7 @@ { "cell_type": "code", "execution_count": 7, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [ { "data": { diff --git a/examples/vqe.ipynb b/examples/vqe.ipynb index 506c95ceb..e31da62f7 100755 --- a/examples/vqe.ipynb +++ b/examples/vqe.ipynb @@ -894,9 +894,7 @@ { "cell_type": "code", "execution_count": 17, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [ { "name": "stdout", From 769baae2488c2a6feb1a6f90e00c6f0646ecc381 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Tue, 16 Aug 2022 15:21:29 -0400 Subject: [PATCH 10/35] Updated the pip+git. --- examples/adapt.ipynb | 2 +- examples/classical_shadows.ipynb | 2 +- examples/dmet.ipynb | 2 +- examples/oniom.ipynb | 2 +- examples/overview_endtoend.ipynb | 28 +++----------------- examples/vqe.ipynb | 2 +- examples/vqe_custom_ansatz_hamiltonian.ipynb | 11 ++++++-- 7 files changed, 17 insertions(+), 32 deletions(-) diff --git a/examples/adapt.ipynb b/examples/adapt.ipynb index 7eb8e48e4..c3e4785a0 100755 --- a/examples/adapt.ipynb +++ b/examples/adapt.ipynb @@ -24,7 +24,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet" + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" ] }, { diff --git a/examples/classical_shadows.ipynb b/examples/classical_shadows.ipynb index 1bb4d0c16..5e4e9141f 100644 --- a/examples/classical_shadows.ipynb +++ b/examples/classical_shadows.ipynb @@ -27,7 +27,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet" + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" ] }, { diff --git a/examples/dmet.ipynb b/examples/dmet.ipynb index 8b0070fa2..19a6e9016 100755 --- a/examples/dmet.ipynb +++ b/examples/dmet.ipynb @@ -41,7 +41,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet" + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" ] }, { diff --git a/examples/oniom.ipynb b/examples/oniom.ipynb index b2494eba6..d73d7d168 100755 --- a/examples/oniom.ipynb +++ b/examples/oniom.ipynb @@ -26,7 +26,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet" + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" ] }, { diff --git a/examples/overview_endtoend.ipynb b/examples/overview_endtoend.ipynb index faeecfccd..d3cde2cf2 100644 --- a/examples/overview_endtoend.ipynb +++ b/examples/overview_endtoend.ipynb @@ -51,38 +51,16 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "scrolled": true }, - "outputs": [ - { - "data": { - "text/plain": [ - "['__cached__',\n", - " '__doc__',\n", - " '__file__',\n", - " '__loader__',\n", - " '__name__',\n", - " '__package__',\n", - " '__path__',\n", - " '__spec__',\n", - " 'logging']" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Pretty printer for more readable outputs\n", "import pprint\n", "pp = pprint.PrettyPrinter(width=160, compact=False, indent=1)\n", - "from pprint import pprint\n", - "\n", - "import google\n", - "dir(google)" + "from pprint import pprint" ] }, { diff --git a/examples/vqe.ipynb b/examples/vqe.ipynb index e31da62f7..e28ae4508 100755 --- a/examples/vqe.ipynb +++ b/examples/vqe.ipynb @@ -40,7 +40,7 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet\n", + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet\n", "\n", "# Installation of qulacs if not already installed.\n", "try:\n", diff --git a/examples/vqe_custom_ansatz_hamiltonian.ipynb b/examples/vqe_custom_ansatz_hamiltonian.ipynb index a0acd47a6..be9f4228c 100755 --- a/examples/vqe_custom_ansatz_hamiltonian.ipynb +++ b/examples/vqe_custom_ansatz_hamiltonian.ipynb @@ -19,8 +19,15 @@ "try:\n", " import tangelo\n", "except ModuleNotFoundError:\n", - " !pip install git+https://github.com/AlexandreF-1qbit/Tangelo.git@gcolab --quiet\n", - "\n", + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "import numpy as np\n", "\n", "from tangelo.algorithms import VQESolver, FCISolver\n", From 1d7735a2ce309867f29fc7102b0b850ca8738d65 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Tue, 16 Aug 2022 15:22:34 -0400 Subject: [PATCH 11/35] Deleted examples/README. --- examples/README.md | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 examples/README.md diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 908f3af95..000000000 --- a/examples/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Tangelo Examples - -| Notebook | GColab link | -|----------|-------------| -| VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe.ipynb | -| Custom VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe_custom_ansatz_hamiltonian.ipynb | -| ADAPT-VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/adapt.ipynb | -| DMET | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/dmet.ipynb | -| ONIOM | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/oniom.ipynb | -| Classical Shadows | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/classical_shadows.ipynb | From 1c402db50eb1725dbecf55a45679fd2214268acb Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:29:19 -0400 Subject: [PATCH 12/35] Added a sentence. Linq notebooks also. --- examples/adapt.ipynb | 4 ++- examples/classical_shadows.ipynb | 4 ++- examples/dmet.ipynb | 28 +++++++++--------- examples/linq/1.the_basics.ipynb | 18 ++++++++++-- examples/linq/2.qpu_connection.ipynb | 19 +++++++++--- examples/linq/3.noisy_simulation.ipynb | 20 ++++++++++--- examples/oniom.ipynb | 30 ++++++++++--------- examples/vqe.ipynb | 40 +++++++++++++------------- 8 files changed, 102 insertions(+), 61 deletions(-) diff --git a/examples/adapt.ipynb b/examples/adapt.ipynb index c3e4785a0..1ae6de723 100755 --- a/examples/adapt.ipynb +++ b/examples/adapt.ipynb @@ -11,7 +11,9 @@ "\n", "In ADAPT-VQE, an ansatz which approximates not UCCSD/UCCGSD, but in fact FCI, is built iteratively. Over a series of cycles, the ansatz circuit is grown to achieve an approximation to FCI with a minimal number of circuit elements. In this way, ADAPT-VQE can be thought as a meta-VQE: at each cycle, a new ansatz is defined, and its parameters optimized according to conventional VQE. As the cycles proceed, the ansatz grows in both complexity and expressibility. This algorithm comes at the expense of a significant increase in measurement overhead. In order to identify the best operator to append to the present ansatz circuit, a large number of measurements are performed to rank the available operators in order of their ability to further reduce the ansatz state energy.\n", "\n", - "In this notebook, we explore the implementation of this algorithm, available in Tangelo. The original algorithm is examined first, and has shown some success in reducing the number of variational parameters required to express the quantum state. Then, we examine another version of ADAPT-VQE which is successful at reducing the circuit size by using a pool of operators defined from the Qubit Hamiltonian." + "In this notebook, we explore the implementation of this algorithm, available in Tangelo. The original algorithm is examined first, and has shown some success in reducing the number of variational parameters required to express the quantum state. Then, we examine another version of ADAPT-VQE which is successful at reducing the circuit size by using a pool of operators defined from the Qubit Hamiltonian.\n", + "\n", + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." ] }, { diff --git a/examples/classical_shadows.ipynb b/examples/classical_shadows.ipynb index 5e4e9141f..7d4da2b1f 100644 --- a/examples/classical_shadows.ipynb +++ b/examples/classical_shadows.ipynb @@ -14,7 +14,9 @@ "\n", "![Classical Shadows overview](img/classical_shadow_overview.png \"Classical Shadow\")\n", "\n", - "The randomized, derandomized and adaptive shadow protocols using the single-qubit Pauli basis as a set of unitaries are currently available in Tangelo. This introduction will shed light on how to leverage their use in your own investigation, and highlight the main differences between these approaches. At the end of this notebook, a comparison is made between energies predicted with those techniques and the one computed by using a Hamiltonian partitioning approach relying on qubitwise commutativity." + "The randomized, derandomized and adaptive shadow protocols using the single-qubit Pauli basis as a set of unitaries are currently available in Tangelo. This introduction will shed light on how to leverage their use in your own investigation, and highlight the main differences between these approaches. At the end of this notebook, a comparison is made between energies predicted with those techniques and the one computed by using a Hamiltonian partitioning approach relying on qubitwise commutativity.\n", + "\n", + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." ] }, { diff --git a/examples/dmet.ipynb b/examples/dmet.ipynb index 19a6e9016..db2f33110 100755 --- a/examples/dmet.ipynb +++ b/examples/dmet.ipynb @@ -15,20 +15,7 @@ "\n", "Such approaches enable us to study how combining classical and quantum algorithms may play a role in the resolution of problems beyond toy models, and even maybe provide a configurable and scalable path forward in the future, towards much more ambitious molecular systems.\n", "\n", - "In order to run this notebook, you need to install the `tangelo` python package, or add it to your PYTHONPATH." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Table of contents:\n", - "* [1. Introduction](#1)\n", - "* [2. Theory of DMET](#2)\n", - "* [3. First example: DMET-CCSD on Butane](#3)\n", - "* [4. Second example: DMET-VQE on an hydrogen ring](#4)\n", - "* [5. DMET features](#5)\n", - "* [6. Closing words](#6)" + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." ] }, { @@ -44,6 +31,19 @@ " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Table of contents:\n", + "* [1. Introduction](#1)\n", + "* [2. Theory of DMET](#2)\n", + "* [3. First example: DMET-CCSD on Butane](#3)\n", + "* [4. Second example: DMET-VQE on an hydrogen ring](#4)\n", + "* [5. DMET features](#5)\n", + "* [6. Closing words](#6)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/examples/linq/1.the_basics.ipynb b/examples/linq/1.the_basics.ipynb index ba98f63e8..a034f854f 100755 --- a/examples/linq/1.the_basics.ipynb +++ b/examples/linq/1.the_basics.ipynb @@ -36,9 +36,21 @@ "\n", "In order to run the contents of this notebook, you need to have the `tangelo` package installed in your python environment. Some cells may require that a specific backend (such as `qiskit`, `qulacs`...) is installed to run.\n", "\n", - "Please have a look at the installation instructions, if you need.\n", - "\n", - "---" + "Please have a look at the installation instructions, if you need. Executing the cell below provides a quick way of installing the requirements of this notebook." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet\n", + " !pip install qiskit qulacs amazon-braket-sdk --quiet" ] }, { diff --git a/examples/linq/2.qpu_connection.ipynb b/examples/linq/2.qpu_connection.ipynb index 3001918f9..0cca9fd87 100755 --- a/examples/linq/2.qpu_connection.ipynb +++ b/examples/linq/2.qpu_connection.ipynb @@ -36,10 +36,21 @@ "source": [ "## Requirements\n", "\n", - "- Tangelo needs to be installed in your environment.\n", - "- Ensure you have valid ID tokens and logins for the services of your choice (IonQ, Braket...), and that your environment is ready to use them (e.g install their SDK and dependencies according to the instructions they provide)\n", - "\n", - "---" + "- Tangelo needs to be installed in your environment. If not, executing the cell below would install Tangelo in your environement.\n", + "- Ensure you have valid ID tokens and logins for the services of your choice (IonQ, Braket...), and that your environment is ready to use them (e.g install their SDK and dependencies according to the instructions they provide)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" ] }, { diff --git a/examples/linq/3.noisy_simulation.ipynb b/examples/linq/3.noisy_simulation.ipynb index 65afac82c..aa4cb786c 100755 --- a/examples/linq/3.noisy_simulation.ipynb +++ b/examples/linq/3.noisy_simulation.ipynb @@ -34,9 +34,21 @@ "source": [ "## Requirements\n", "\n", - "In order to run the contents of this notebook, I simply recommend that you install `tangelo` as per the installation instructions, as well as one or several backends supporting noisy simulation (cirq, qiskit, qulacs...). You can install them with `pip`.\n", - "\n", - "---" + "In order to run the contents of this notebook, I simply recommend that you install `tangelo` as per the installation instructions, as well as one or several backends supporting noisy simulation (cirq, qiskit, qulacs...). You can install them with `pip`. Executing the cell below provides a quick way of installing a minimal set of backends to execute code cells in this notebook." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet\n", + " !pip install qiskit qulacs amazon-braket-sdk --quiet" ] }, { @@ -536,7 +548,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, diff --git a/examples/oniom.ipynb b/examples/oniom.ipynb index d73d7d168..d48ebd6f4 100755 --- a/examples/oniom.ipynb +++ b/examples/oniom.ipynb @@ -16,19 +16,6 @@ "* [3. Closing words](#3)\n" ] }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "# Installation of tangelo if not already installed.\n", - "try:\n", - " import tangelo\n", - "except ModuleNotFoundError:\n", - " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -44,7 +31,22 @@ "\n", "Where $E_{\\text{All}}$, $E_{\\text{Fragment}_i}$ are respectively the energy of the whole system and the energy of a fragment labelled $i$. The general procedure for ONIOM is as follows. The user identifies a system of interest and a low-cost method is used to compute its total energy ($E_{\\text{All}}^{\\text{Low}}$). Subsequently, a subset of the molecule is defined as a model fragment and it is isolated by using an atom (or a functional group) to keep the valence shell fully populated. $E_{\\text{Fragment}_i}^{\\text{Low}}$ is computed for the fragment using the same low-cost method as used initially for the whole system, and a high-cost method ($E_{\\text{Fragment}_i}^{\\text{High}}$). The difference in energy between the high-cost and low-cost methods ($E_{\\text{Fragment}_i}^{\\text{High}} - E_{\\text{Fragment}_i}^{\\text{Low}}$) is then added to our total energy. This way, we can interpret the ONIOM method as an iterative procedure where the error associated with our low-cost solver is removed.\n", "\n", - "The equation above is formulated to allow us to expand ONIOM beyond a single fragment. In principle, many such fragments can be defined to progressively improve the accuracy or efficiency of the calculations. This may apply to when we have more than one active site on our large molecule, or where an incremental strategy can be utilized to further mitigate errors associated with using our low-cost method in the vicinity of our active region." + "The equation above is formulated to allow us to expand ONIOM beyond a single fragment. In principle, many such fragments can be defined to progressively improve the accuracy or efficiency of the calculations. This may apply to when we have more than one active site on our large molecule, or where an incremental strategy can be utilized to further mitigate errors associated with using our low-cost method in the vicinity of our active region.\n", + "\n", + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" ] }, { diff --git a/examples/vqe.ipynb b/examples/vqe.ipynb index e28ae4508..97c527851 100755 --- a/examples/vqe.ipynb +++ b/examples/vqe.ipynb @@ -8,26 +8,7 @@ "\n", "The Tangelo Python package provides various toolboxes, which can be leveraged to build quantum chemistry workflows relying on quantum computing. One example of such a workflow is the Variational Quantum Eigensolver (VQE). We provide an implementation of VQE that supports several options, and may provide valuable help in your research and applications.\n", "\n", - "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Table of contents:\n", - "* [1. Overview of VQE](#1)\n", - "* [2. VQESolver class](#2)\n", - " * [2.1 VQESolver instantiation](#21)\n", - " * [2.2 VQESolver.build](#22)\n", - " * [2.3 VQESolver.simulate](#23)\n", - " * [2.4 VQESolver.energy_estimation](#24)\n", - " * [2.5 VQESolver.get_resources](#25)\n", - " * [2.6 VQESolver.get_rdm](#26)\n", - "* [3. Option: frozen orbitals](#3)\n", - "* [4. Option: ansatz and qubit mapping](#4)\n", - "* [5. Option: classical optimizers and initial parameters](#5)\n", - "* [6. Option: compute backend](#6)" + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." ] }, { @@ -49,6 +30,25 @@ " !pip install qulacs --quiet" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Table of contents:\n", + "* [1. Overview of VQE](#1)\n", + "* [2. VQESolver class](#2)\n", + " * [2.1 VQESolver instantiation](#21)\n", + " * [2.2 VQESolver.build](#22)\n", + " * [2.3 VQESolver.simulate](#23)\n", + " * [2.4 VQESolver.energy_estimation](#24)\n", + " * [2.5 VQESolver.get_resources](#25)\n", + " * [2.6 VQESolver.get_rdm](#26)\n", + "* [3. Option: frozen orbitals](#3)\n", + "* [4. Option: ansatz and qubit mapping](#4)\n", + "* [5. Option: classical optimizers and initial parameters](#5)\n", + "* [6. Option: compute backend](#6)" + ] + }, { "cell_type": "markdown", "metadata": {}, From f3f0c3714f26c6989887da4fcae6ca003c39df16 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:29:37 -0400 Subject: [PATCH 13/35] First take at TUTORIALS.rst. --- README.rst | 3 +++ TUTORIALS.rst | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 TUTORIALS.rst diff --git a/README.rst b/README.rst index 9a79ec621..aef192137 100644 --- a/README.rst +++ b/README.rst @@ -150,6 +150,9 @@ them locally, we suggest you use `Jupyter notebooks inside a virtual environment python -m ipykernel install --user --name=myenv +Jupyter notebooks can also be displayed and executed in the cloud, removing the constraint of building a local development envrionement. +This process is described in the `tutorials <./TUTORIALS.rst>`_ file. + Tests ----- diff --git a/TUTORIALS.rst b/TUTORIALS.rst new file mode 100644 index 000000000..c259222b6 --- /dev/null +++ b/TUTORIALS.rst @@ -0,0 +1,38 @@ +Tutorials +========= + +Setting-up a local environment to run jupyter notebooks can be a cumbersome step for uninitiated python users. + +`Google Colab `_ provides a turnkey coding environment for researchers. + +Users can therefore read, execute and collaborate on a code base without leaving the comfort of an internet browser. + +The code is executed in the cloud, thus making the code ready-to-use on every platform that has a cloud connection. + + +Compatible notebooks in Google Colab +------------------------------------ + +The compatible notebooks are listed in the table below. + +| Notebook | GColab link | +|----------|-------------| +| VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe.ipynb | +| Custom VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe_custom_ansatz_hamiltonian.ipynb | +| ADAPT-VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/adapt.ipynb | +| DMET | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/dmet.ipynb | +| ONIOM | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/oniom.ipynb | +| Classical Shadows | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/classical_shadows.ipynb | + +However, adapting a notebook to Google Colab is an easy task. + +Installing a package is something possible, and is explained at this `link `_. + +For our use case, installing Tangelo can be done with this code cell. + +.. code-block:: python + + try: + import tangelo + except ModuleNotFoundError: + !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet From 9c04b4d07adfc440eb5d538b7bf526deffa36582 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:35:20 -0400 Subject: [PATCH 14/35] Format of TUTORIALS.rst. --- TUTORIALS.rst | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index c259222b6..f7755730d 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -2,32 +2,25 @@ Tutorials ========= Setting-up a local environment to run jupyter notebooks can be a cumbersome step for uninitiated python users. - `Google Colab `_ provides a turnkey coding environment for researchers. - Users can therefore read, execute and collaborate on a code base without leaving the comfort of an internet browser. - The code is executed in the cloud, thus making the code ready-to-use on every platform that has a cloud connection. Compatible notebooks in Google Colab ------------------------------------ -The compatible notebooks are listed in the table below. +The compatible notebooks are listed in the list below. -| Notebook | GColab link | -|----------|-------------| -| VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe.ipynb | -| Custom VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe_custom_ansatz_hamiltonian.ipynb | -| ADAPT-VQE | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/adapt.ipynb | -| DMET | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/dmet.ipynb | -| ONIOM | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/oniom.ipynb | -| Classical Shadows | https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/classical_shadows.ipynb | +* `VQE`_ +* `ADAPT-VQE `_ +* `Custom VQE `_ +* `DMET `_ +* `ONIOM `_ +* `Classical Shadows `_ However, adapting a notebook to Google Colab is an easy task. - Installing a package is something possible, and is explained at this `link `_. - For our use case, installing Tangelo can be done with this code cell. .. code-block:: python From 16c0b93489b09e231c4431551b8ca7f377ba7afe Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:36:30 -0400 Subject: [PATCH 15/35] Links to the develop branch. --- TUTORIALS.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index f7755730d..def040b48 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -12,12 +12,12 @@ Compatible notebooks in Google Colab The compatible notebooks are listed in the list below. -* `VQE`_ -* `ADAPT-VQE `_ -* `Custom VQE `_ -* `DMET `_ -* `ONIOM `_ -* `Classical Shadows `_ +* `VQE`_ +* `ADAPT-VQE `_ +* `Custom VQE `_ +* `DMET `_ +* `ONIOM `_ +* `Classical Shadows `_ However, adapting a notebook to Google Colab is an easy task. Installing a package is something possible, and is explained at this `link `_. From e9b7d94e9233d42a0e2ff7b381f3785e2848d9e2 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:37:29 -0400 Subject: [PATCH 16/35] Missing space. --- TUTORIALS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index def040b48..6cec09b4a 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -12,7 +12,7 @@ Compatible notebooks in Google Colab The compatible notebooks are listed in the list below. -* `VQE`_ +* `VQE `_ * `ADAPT-VQE `_ * `Custom VQE `_ * `DMET `_ From 5a342982f0b58fd5e0d91ac68a37b3fab5732ec2 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:40:05 -0400 Subject: [PATCH 17/35] GColab links to the develop branch. --- TUTORIALS.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index 6cec09b4a..c3baaa6d5 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -12,12 +12,12 @@ Compatible notebooks in Google Colab The compatible notebooks are listed in the list below. -* `VQE `_ -* `ADAPT-VQE `_ -* `Custom VQE `_ -* `DMET `_ -* `ONIOM `_ -* `Classical Shadows `_ +* `VQE `_ +* `ADAPT-VQE `_ +* `Custom VQE `_ +* `DMET `_ +* `ONIOM `_ +* `Classical Shadows `_ However, adapting a notebook to Google Colab is an easy task. Installing a package is something possible, and is explained at this `link `_. From 4ebe0be07a6aadb74e2c54c53f234765ce92b827 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:56:09 -0700 Subject: [PATCH 18/35] Update README.rst --- README.rst | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index aef192137..43404ac7c 100644 --- a/README.rst +++ b/README.rst @@ -61,20 +61,23 @@ This package requires a Python 3 environment. We recommend: * installing the "dev" version of Python3 if you encounter missing header errors, such as ``python.h file not found``. * having good C/C++ compilers and BLAS libraries to ensure good overall performance of computation-intensive code. + + Using pip ^^^^^^^^^ -The easiest way to install Tangelo in your environment. We recommend upgrading pip first: +The easiest way to install Tangelo in your local environment. We recommend upgrading pip first: .. code-block:: python -m pip install -–upgrade pip. pip install tangelo-gc + From source, using setuptools ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This package can be installed locally by copying the contents of this repository to any machine. +This package can be installed locally by copying the contents of this repository to any machine. This can be useful if you need a bit more control on your install (such as installing from a particular branch, or tweaking the `setup.py` install to circumvent any trouble on your system): Type the following command in the root directory: .. code-block:: @@ -85,11 +88,18 @@ If the installation of a dependency fails and the reason is not obvious, we sugg separately with ``pip``\ , before trying again. +"No install" notebook method +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A good alternative for users that simply want to quickly get a working environment ready, especially for quick tests, demos, tutorials. +Check out the tutorial section below to see how services such as Google Colab may help you circumvent local installation challenges or go beyond the limitations of your personal computer if you feel short of compute power or memory. + + Optional dependencies ^^^^^^^^^^^^^^^^^^^^^ Tangelo enables users to target various backends. In particular, it integrates quantum circuit simulators such as -``qulacs``\ , ``qiskit``\ , ``cirq`` or ``qdk``. We leave it to you to install the packages of your choice. +``qulacs``\ , ``qiskit``\ , ``cirq`` or ``qdk``. We leave it to you to install the packages of your choice, and refer to their own documentation. Most packages can be installed through pip in a straightforward way: .. code-block:: @@ -136,7 +146,7 @@ Tutorials --------- The ``examples`` folder of this repository contains various Jupyter notebook tutorials, and other examples. -We wrote a number of them, but nothing prevents users from contributing more notebook content ! +We wrote a number of them, but nothing prevents users from contributing more notebook content, to show what they have been doing with Tangelo! You can visualize a number of pre-run notebooks directly on Github or in our Sphinx documentation. If you'd like to be able to run them locally, we suggest you use `Jupyter notebooks inside a virtual environment `_. @@ -150,8 +160,9 @@ them locally, we suggest you use `Jupyter notebooks inside a virtual environment python -m ipykernel install --user --name=myenv -Jupyter notebooks can also be displayed and executed in the cloud, removing the constraint of building a local development envrionement. -This process is described in the `tutorials <./TUTORIALS.rst>`_ file. +Jupyter notebooks can also be displayed and executed in the cloud, with services such as Google Colab. This removes the constraint of building a local development envrionement, and enables users to run interactive notebooks on machines that may provide a better configuration than their own (more RAM, compute power, access to GPUs...). + +Check out our `tutorials <./TUTORIALS.rst>`_ file for more details. Tests ----- From 45f1f2158105da08b1166fac47ca31d3dbc555bb Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 17:10:07 -0400 Subject: [PATCH 19/35] Markdown qemist_client, typos and download data for mifno. --- examples/adapt.ipynb | 2 +- examples/classical_shadows.ipynb | 2 +- examples/dmet.ipynb | 2 +- examples/linq/3.noisy_simulation.ipynb | 2 +- examples/mifno.ipynb | 128 +++++++++++++++---------- examples/oniom.ipynb | 2 +- examples/overview_endtoend.ipynb | 40 ++++---- examples/vqe.ipynb | 2 +- 8 files changed, 101 insertions(+), 79 deletions(-) diff --git a/examples/adapt.ipynb b/examples/adapt.ipynb index 1ae6de723..680872b3b 100755 --- a/examples/adapt.ipynb +++ b/examples/adapt.ipynb @@ -13,7 +13,7 @@ "\n", "In this notebook, we explore the implementation of this algorithm, available in Tangelo. The original algorithm is examined first, and has shown some success in reducing the number of variational parameters required to express the quantum state. Then, we examine another version of ADAPT-VQE which is successful at reducing the circuit size by using a pool of operators defined from the Qubit Hamiltonian.\n", "\n", - "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, executing the cell below installs the minimal requirements for this notebook." ] }, { diff --git a/examples/classical_shadows.ipynb b/examples/classical_shadows.ipynb index 7d4da2b1f..ff6f34a80 100644 --- a/examples/classical_shadows.ipynb +++ b/examples/classical_shadows.ipynb @@ -16,7 +16,7 @@ "\n", "The randomized, derandomized and adaptive shadow protocols using the single-qubit Pauli basis as a set of unitaries are currently available in Tangelo. This introduction will shed light on how to leverage their use in your own investigation, and highlight the main differences between these approaches. At the end of this notebook, a comparison is made between energies predicted with those techniques and the one computed by using a Hamiltonian partitioning approach relying on qubitwise commutativity.\n", "\n", - "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, executing the cell below installs the minimal requirements for this notebook." ] }, { diff --git a/examples/dmet.ipynb b/examples/dmet.ipynb index db2f33110..a477ee0ae 100755 --- a/examples/dmet.ipynb +++ b/examples/dmet.ipynb @@ -15,7 +15,7 @@ "\n", "Such approaches enable us to study how combining classical and quantum algorithms may play a role in the resolution of problems beyond toy models, and even maybe provide a configurable and scalable path forward in the future, towards much more ambitious molecular systems.\n", "\n", - "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, executing the cell below installs the minimal requirements for this notebook." ] }, { diff --git a/examples/linq/3.noisy_simulation.ipynb b/examples/linq/3.noisy_simulation.ipynb index aa4cb786c..97d8a2d3a 100755 --- a/examples/linq/3.noisy_simulation.ipynb +++ b/examples/linq/3.noisy_simulation.ipynb @@ -562,7 +562,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.9.9" } }, "nbformat": 4, diff --git a/examples/mifno.ipynb b/examples/mifno.ipynb index 6bacf8ed4..e23336f1e 100644 --- a/examples/mifno.ipynb +++ b/examples/mifno.ipynb @@ -12,6 +12,32 @@ "\n", "The first section provides a high-level description of the MI-FNO approach. The second one briefly shows how QEMIST Cloud can apply this approach to a usecase, and provide reference results computed with high-accuracy classical solvers. We then focus on the API provided in Tangelo allowing users to combine the MI-FNO performed by QEMIST Cloud and any quantum workflow written with Tangelo.\n", "\n", + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, executing the cell below installs the minimal requirements for this notebook." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet\n", + "\n", + "# Download the data folder at https://github.com/goodchemistryco/Tangelo/tree/main/examples/data\n", + "import os\n", + "if not os.path.isdir(\"data\"):\n", + " !sudo apt install subversion\n", + " !svn checkout https://github.com/goodchemistryco/Tangelo/branches/develop/examples/data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "## Use case\n", "\n", "Our use case here is the hydrogen fluoride (HF) system defined below, using the `sto-3g` basis, chosen for simplicity. However, the MI-FNO method can be used to tackle much larger systems." @@ -19,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -168,7 +194,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -184,7 +210,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -195,20 +221,20 @@ "Total MI-FNO energy = -98.59655271223816\n", "Correlation energy = -0.025795120623911316\n", "Mean-field energy = -98.57075759161424\n", - " problem_handle epsilon correction energy_total \\\n", - "(1,) 65652562505002413 -0.001326 0.0 -98.572083 \n", - "(2,) 10837505518890413 -0.019846 0.0 -98.590604 \n", - "(3,) 31462118862908845 -0.000862 0.0 -98.571619 \n", - "(4,) 49501973643554221 -0.000756 0.0 -98.571513 \n", - "(1, 2) 65302015864237516 -0.003024 0.0 -98.594953 \n", - "(1, 3) 53405772498103756 0.000085 0.0 -98.572860 \n", - "(1, 4) 13411621153304012 0.000142 0.0 -98.572697 \n", - "(2, 3) 22700772126125516 -0.000845 0.0 -98.592310 \n", - "(2, 4) 27549614109650380 0.000124 0.0 -98.591235 \n", - "(3, 4) 23150438022147532 0.000078 0.0 -98.572297 \n", - "(1, 2, 3) 30910159730798073 0.000466 0.0 -98.596109 \n", - "(1, 2, 4) 13137250052500985 -0.000016 0.0 -98.595458 \n", - "(2, 3, 4) 17864205159132665 -0.000017 0.0 -98.592881 \n", + " epsilon problem_handle energy_total correction \\\n", + "(1,) -0.001326 65652562505002413 -98.572083 0.0 \n", + "(2,) -0.019846 10837505518890413 -98.590604 0.0 \n", + "(3,) -0.000862 31462118862908845 -98.571619 0.0 \n", + "(4,) -0.000756 49501973643554221 -98.571513 0.0 \n", + "(1, 2) -0.003024 65302015864237516 -98.594953 0.0 \n", + "(1, 3) 0.000085 53405772498103756 -98.572860 0.0 \n", + "(1, 4) 0.000142 13411621153304012 -98.572697 0.0 \n", + "(2, 3) -0.000845 22700772126125516 -98.592310 0.0 \n", + "(2, 4) 0.000124 27549614109650380 -98.591235 0.0 \n", + "(3, 4) 0.000078 23150438022147532 -98.572297 0.0 \n", + "(1, 2, 3) 0.000466 30910159730798073 -98.596109 0.0 \n", + "(1, 2, 4) -0.000016 13137250052500985 -98.595458 0.0 \n", + "(2, 3, 4) -0.000017 17864205159132665 -98.592881 0.0 \n", "\n", " energy_correlation \n", "(1,) -0.001326 \n", @@ -256,7 +282,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -276,7 +302,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -323,7 +349,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -332,43 +358,43 @@ "text": [ "Iteration 1 of QITE with starting energy -98.57075759161438\n", "Iteration 2 of QITE with starting energy -98.57113742411626\n", - "Iteration 3 of QITE with starting energy -98.57140787803596\n", - "Iteration 4 of QITE with starting energy -98.57160051304942\n", - "Iteration 5 of QITE with starting energy -98.57173778008372\n", - "Iteration 6 of QITE with starting energy -98.57183564786015\n", - "Iteration 7 of QITE with starting energy -98.57190547375154\n", - "Iteration 8 of QITE with starting energy -98.57195533547332\n", - "Iteration 9 of QITE with starting energy -98.57199097854448\n", - "Iteration 10 of QITE with starting energy -98.57201649016257\n", - "Iteration 11 of QITE with starting energy -98.57203477838605\n", - "Iteration 12 of QITE with starting energy -98.57204791282895\n", - "Iteration 13 of QITE with starting energy -98.57205736687135\n", - "Iteration 14 of QITE with starting energy -98.57206418984897\n", - "Iteration 15 of QITE with starting energy -98.57206912946631\n", - "Iteration 16 of QITE with starting energy -98.57207271882451\n", - "Iteration 17 of QITE with starting energy -98.57207533829896\n", - "Iteration 18 of QITE with starting energy -98.5720772595381\n", - "Iteration 19 of QITE with starting energy -98.57207867675483\n", - "Iteration 20 of QITE with starting energy -98.57207972898374\n", - "Iteration 21 of QITE with starting energy -98.57208051591682\n", - "Iteration 22 of QITE with starting energy -98.57208110917304\n", - "Iteration 23 of QITE with starting energy -98.5720815603213\n", - "Iteration 24 of QITE with starting energy -98.5720819065949\n", - "Iteration 25 of QITE with starting energy -98.57208217496307\n", - "Iteration 26 of QITE with starting energy -98.57208238503476\n", - "Iteration 27 of QITE with starting energy -98.57208255113032\n", - "Iteration 28 of QITE with starting energy -98.5720826837612\n", - "Iteration 29 of QITE with starting energy -98.57208279068848\n", - "Final energy of QITE is -98.57208287768049\n" + "Iteration 3 of QITE with starting energy -98.571407878036\n", + "Iteration 4 of QITE with starting energy -98.57160051305051\n", + "Iteration 5 of QITE with starting energy -98.57173778008789\n", + "Iteration 6 of QITE with starting energy -98.57183564786958\n", + "Iteration 7 of QITE with starting energy -98.57190547376783\n", + "Iteration 8 of QITE with starting energy -98.57195533549731\n", + "Iteration 9 of QITE with starting energy -98.57199097857621\n", + "Iteration 10 of QITE with starting energy -98.57201649020138\n", + "Iteration 11 of QITE with starting energy -98.57203477843082\n", + "Iteration 12 of QITE with starting energy -98.5720479128784\n", + "Iteration 13 of QITE with starting energy -98.57205736692381\n", + "Iteration 14 of QITE with starting energy -98.57206418990326\n", + "Iteration 15 of QITE with starting energy -98.57206912952093\n", + "Iteration 16 of QITE with starting energy -98.5720727188785\n", + "Iteration 17 of QITE with starting energy -98.5720753383512\n", + "Iteration 18 of QITE with starting energy -98.57207725958806\n", + "Iteration 19 of QITE with starting energy -98.57207867680201\n", + "Iteration 20 of QITE with starting energy -98.57207972902779\n", + "Iteration 21 of QITE with starting energy -98.57208051595758\n", + "Iteration 22 of QITE with starting energy -98.57208110921034\n", + "Iteration 23 of QITE with starting energy -98.57208156035534\n", + "Iteration 24 of QITE with starting energy -98.57208190662573\n", + "Iteration 25 of QITE with starting energy -98.57208217499077\n", + "Iteration 26 of QITE with starting energy -98.57208238505962\n", + "Iteration 27 of QITE with starting energy -98.57208255115249\n", + "Iteration 28 of QITE with starting energy -98.57208268378093\n", + "Iteration 29 of QITE with starting energy -98.572082790706\n", + "Final energy of QITE is -98.57208287769595\n" ] }, { "data": { "text/plain": [ - "-98.57208287768049" + "-98.57208287769595" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -401,7 +427,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { diff --git a/examples/oniom.ipynb b/examples/oniom.ipynb index d48ebd6f4..00809f525 100755 --- a/examples/oniom.ipynb +++ b/examples/oniom.ipynb @@ -33,7 +33,7 @@ "\n", "The equation above is formulated to allow us to expand ONIOM beyond a single fragment. In principle, many such fragments can be defined to progressively improve the accuracy or efficiency of the calculations. This may apply to when we have more than one active site on our large molecule, or where an incremental strategy can be utilized to further mitigate errors associated with using our low-cost method in the vicinity of our active region.\n", "\n", - "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, executing the cell below installs the minimal requirements for this notebook." ] }, { diff --git a/examples/overview_endtoend.ipynb b/examples/overview_endtoend.ipynb index d3cde2cf2..73c232845 100644 --- a/examples/overview_endtoend.ipynb +++ b/examples/overview_endtoend.ipynb @@ -46,7 +46,7 @@ "source": [ "## Setting up your environment \n", "\n", - "In order to run this notebook, `tangelo` needs to be installed in your Python environment, or be found in your PYTHONPATH. Please refer to the installation instructions for any additional information, and how to install optional dependencies such as performant quantum circuit simulators." + "In order to run this notebook, `tangelo` needs to be installed in your Python environment, or be found in your PYTHONPATH. Please refer to the installation instructions for any additional information, and how to install optional dependencies such as performant quantum circuit simulators. If Tangelo is not already installed, executing the cell below installs the minimal requirements for this notebook." ] }, { @@ -60,7 +60,13 @@ "# Pretty printer for more readable outputs\n", "import pprint\n", "pp = pprint.PrettyPrinter(width=160, compact=False, indent=1)\n", - "from pprint import pprint" + "from pprint import pprint\n", + "\n", + "# Installation of tangelo if not already installed.\n", + "try:\n", + " import tangelo\n", + "except ModuleNotFoundError:\n", + " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet" ] }, { @@ -684,25 +690,9 @@ "\n", "The simplest way to submit an experiment to any device available in the supported quantum cloud services is through QEMIST Cloud's client library, allowing users to run quantum hardware experiments using their QEMIST Cloud account credentials and credits. This is possible if you have access to QEMIST Cloud, and have installed `qemist-client` Python package. For more details about this feature, please don't hesitate to refer to our [dedicated notebook](qemist_cloud_hardware_experiments_braket.ipynb), and reach out to us about QEMIST Cloud.\n", "\n", - "Below, a simple code snippet illustrating how to run 10,000 shots of the `YY` circuit on IonQ's hardware, through Amazon's Braket quantum cloud services:" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'braket_ionq': 100.3, 'braket_rigetti': 3.8}\n" - ] - } - ], - "source": [ + "Below, a simple code snippet illustrating how to run 10,000 shots of the `YY` circuit on IonQ's hardware, through Amazon's Braket quantum cloud services:\n", + "\n", + "```python\n", "# Retrieve both these values from your QEMIST Cloud dashboard\n", "import os\n", "os.environ['QEMIST_PROJECT_ID'] = \"your_project_id_string\"\n", @@ -721,7 +711,13 @@ "# This two commands would respecfully submit the job to the quantum device and make a blocking call\n", "# to retrieve the results, through a job ID returned by QEMIST Cloud\n", "# job_id = job_submit(circuit_YY, n_shots=n_shots, backend=backend)\n", - "# freqs, raw_data = job_result(job_id)" + "# freqs, raw_data = job_result(job_id)\n", + "```\n", + "\n", + "Output:\n", + "```output\n", + "{'braket_ionq': 100.3, 'braket_rigetti': 3.8}\n", + "```" ] }, { diff --git a/examples/vqe.ipynb b/examples/vqe.ipynb index 97c527851..574106e4f 100755 --- a/examples/vqe.ipynb +++ b/examples/vqe.ipynb @@ -8,7 +8,7 @@ "\n", "The Tangelo Python package provides various toolboxes, which can be leveraged to build quantum chemistry workflows relying on quantum computing. One example of such a workflow is the Variational Quantum Eigensolver (VQE). We provide an implementation of VQE that supports several options, and may provide valuable help in your research and applications.\n", "\n", - "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, the executing the cell below installs the minimal requirements for this notebook." + "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, executing the cell below installs the minimal requirements for this notebook." ] }, { From c1a24f76802d7c1ad0eb32bc65db4ef3952105b1 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 17:19:45 -0400 Subject: [PATCH 20/35] Minimal tutorial before dots. --- TUTORIALS.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index c3baaa6d5..1d8887b4f 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -4,22 +4,25 @@ Tutorials Setting-up a local environment to run jupyter notebooks can be a cumbersome step for uninitiated python users. `Google Colab `_ provides a turnkey coding environment for researchers. Users can therefore read, execute and collaborate on a code base without leaving the comfort of an internet browser. -The code is executed in the cloud, thus making the code ready-to-use on every platform that has a cloud connection. +The code is executed in the cloud, thus making the code ready-to-use on every operating system that has internet access. Compatible notebooks in Google Colab ------------------------------------ -The compatible notebooks are listed in the list below. +The compatible notebooks are listed below: * `VQE `_ -* `ADAPT-VQE `_ * `Custom VQE `_ +* `ADAPT-VQE `_ * `DMET `_ * `ONIOM `_ +* `MIFNO `_ * `Classical Shadows `_ +* `linq/1.the_basics `_ +* `linq/3.noisy_simulation `_ -However, adapting a notebook to Google Colab is an easy task. +However, adapting a new notebook for Google Colab is an easy task. Installing a package is something possible, and is explained at this `link `_. For our use case, installing Tangelo can be done with this code cell. From 9c2f19ecc97303a78243b353e1eb5f0ff3bce836 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 14:24:49 -0700 Subject: [PATCH 21/35] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 43404ac7c..b5e607fd8 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,7 @@ The easiest way to install Tangelo in your local environment. We recommend upgra From source, using setuptools ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This package can be installed locally by copying the contents of this repository to any machine. This can be useful if you need a bit more control on your install (such as installing from a particular branch, or tweaking the `setup.py` install to circumvent any trouble on your system): +This package can be installed locally by copying the contents of this repository to any machine. This can be useful if you need a bit more control on your install (such as installing from a particular branch, or tweaking the ``setup.py`` install to circumvent any trouble on your system): Type the following command in the root directory: .. code-block:: From 5c6161e9e994bd84fcce3f9169562e0a8135d871 Mon Sep 17 00:00:00 2001 From: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 17:25:42 -0400 Subject: [PATCH 22/35] Bullet points about TUTORIALS.rst. --- TUTORIALS.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index 1d8887b4f..1727c6726 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -1,6 +1,16 @@ Tutorials ========= +* Intro about Tangelo, potential reach and philosophy of our examples. +* Mention jupyter notebook can be saved in Google Drive. +* Put a figure or an explanation on how to open any notebook from github. +* Talk about nbviewer, https://mybinder.org/? +* Better way of presenting links: shields.io badges +* Put a link of this website: https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb + +What is Google Colab? +--------------------- + Setting-up a local environment to run jupyter notebooks can be a cumbersome step for uninitiated python users. `Google Colab `_ provides a turnkey coding environment for researchers. Users can therefore read, execute and collaborate on a code base without leaving the comfort of an internet browser. From 784789cbf59789268f8cc58cd598e1a2ac0c3003 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 14:30:47 -0700 Subject: [PATCH 23/35] Update README.rst --- README.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index b5e607fd8..eb043228b 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,7 @@ The easiest way to install Tangelo in your local environment. We recommend upgra From source, using setuptools ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This package can be installed locally by copying the contents of this repository to any machine. This can be useful if you need a bit more control on your install (such as installing from a particular branch, or tweaking the ``setup.py`` install to circumvent any trouble on your system): +This package can be installed locally by copying the contents of this repository to any machine. This can be useful if you need a bit more control on your install (such as installing from a particular branch, or tweaking the ``setup.py`` install to circumvent any issue on your system). Type the following command in the root directory: .. code-block:: @@ -147,8 +147,9 @@ Tutorials The ``examples`` folder of this repository contains various Jupyter notebook tutorials, and other examples. We wrote a number of them, but nothing prevents users from contributing more notebook content, to show what they have been doing with Tangelo! -You can visualize a number of pre-run notebooks directly on Github or in our Sphinx documentation. If you'd like to be able to run -them locally, we suggest you use `Jupyter notebooks inside a virtual environment `_. +You can visualize notebooks directly on Github, most of them have been pre-run. + +If you'd like to be able to run them locally, we suggest you use `Jupyter notebooks inside a virtual environment `_. - Install Jupyter and ipykernel in your environment: .. code-block:: @@ -160,7 +161,7 @@ them locally, we suggest you use `Jupyter notebooks inside a virtual environment python -m ipykernel install --user --name=myenv -Jupyter notebooks can also be displayed and executed in the cloud, with services such as Google Colab. This removes the constraint of building a local development envrionement, and enables users to run interactive notebooks on machines that may provide a better configuration than their own (more RAM, compute power, access to GPUs...). +Jupyter notebooks can also be displayed and executed in the cloud, with services such as Google Colab. This removes the constraint of building a local development envrionement, and enables users to run interactive notebooks on machines that may provide a better configuration than their own (more RAM, compute power, access to GPUs...). This may come in handy for users who want to get started quickly, especially for quick tests, demos and tutorials. Check out our `tutorials <./TUTORIALS.rst>`_ file for more details. From fe06a5364a1f8dc7ffccbbfc8fd18959d179b0e5 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 18:59:12 -0700 Subject: [PATCH 24/35] Update 3.noisy_simulation.ipynb --- examples/linq/3.noisy_simulation.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/linq/3.noisy_simulation.ipynb b/examples/linq/3.noisy_simulation.ipynb index 97d8a2d3a..e5da37ddc 100755 --- a/examples/linq/3.noisy_simulation.ipynb +++ b/examples/linq/3.noisy_simulation.ipynb @@ -34,7 +34,7 @@ "source": [ "## Requirements\n", "\n", - "In order to run the contents of this notebook, I simply recommend that you install `tangelo` as per the installation instructions, as well as one or several backends supporting noisy simulation (cirq, qiskit, qulacs...). You can install them with `pip`. Executing the cell below provides a quick way of installing a minimal set of backends to execute code cells in this notebook." + "In order to run the contents of this notebook, I simply recommend that you install `tangelo` as per the installation instructions, as well as one or several backends supporting noisy simulation (cirq, qiskit, qulacs...). You can install them with `pip`. Executing the cell below provides a quick way of installing Tangelo, as well as minimal set of backends to execute code cells in this notebook." ] }, { From de2961585af6fd1747c7313f8d717ad4fc98de98 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 19:05:10 -0700 Subject: [PATCH 25/35] Update 3.noisy_simulation.ipynb --- examples/linq/3.noisy_simulation.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/linq/3.noisy_simulation.ipynb b/examples/linq/3.noisy_simulation.ipynb index e5da37ddc..e631842ed 100755 --- a/examples/linq/3.noisy_simulation.ipynb +++ b/examples/linq/3.noisy_simulation.ipynb @@ -34,7 +34,7 @@ "source": [ "## Requirements\n", "\n", - "In order to run the contents of this notebook, I simply recommend that you install `tangelo` as per the installation instructions, as well as one or several backends supporting noisy simulation (cirq, qiskit, qulacs...). You can install them with `pip`. Executing the cell below provides a quick way of installing Tangelo, as well as minimal set of backends to execute code cells in this notebook." + "In order to run the contents of this notebook, I simply recommend that you install `tangelo` as per the installation instructions, as well as one or several backends supporting noisy simulation (cirq, qiskit, qulacs...). You can install them with `pip`. Executing the cell below provides a quick way of installing Tangelo, as well as the minimal set of backends to execute code cells in this notebook." ] }, { From ed983a2ce62c371898879f776f84806c8219975c Mon Sep 17 00:00:00 2001 From: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 19:10:01 -0700 Subject: [PATCH 26/35] Update mifno.ipynb --- examples/mifno.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mifno.ipynb b/examples/mifno.ipynb index e23336f1e..8ad3bbf42 100644 --- a/examples/mifno.ipynb +++ b/examples/mifno.ipynb @@ -27,7 +27,7 @@ "except ModuleNotFoundError:\n", " !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet\n", "\n", - "# Download the data folder at https://github.com/goodchemistryco/Tangelo/tree/main/examples/data\n", + "# Download the data folder at https://github.com/goodchemistryco/Tangelo/tree/develop/examples/data\n", "import os\n", "if not os.path.isdir(\"data\"):\n", " !sudo apt install subversion\n", From d0004516e16d7d346e6b4561167b818dcf79d657 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Date: Thu, 18 Aug 2022 19:13:18 -0700 Subject: [PATCH 27/35] Update 2.qpu_connection.ipynb --- examples/linq/2.qpu_connection.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/linq/2.qpu_connection.ipynb b/examples/linq/2.qpu_connection.ipynb index 0cca9fd87..4d96369fa 100755 --- a/examples/linq/2.qpu_connection.ipynb +++ b/examples/linq/2.qpu_connection.ipynb @@ -36,7 +36,7 @@ "source": [ "## Requirements\n", "\n", - "- Tangelo needs to be installed in your environment. If not, executing the cell below would install Tangelo in your environement.\n", + "- Tangelo needs to be installed in your environment. The cell below does this installation for you if it is not found.\n", "- Ensure you have valid ID tokens and logins for the services of your choice (IonQ, Braket...), and that your environment is ready to use them (e.g install their SDK and dependencies according to the instructions they provide)" ] }, From d71538d5fcb636d6ff5c48f380ae7a83961125c8 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Fri, 19 Aug 2022 11:45:05 -0700 Subject: [PATCH 28/35] Changes to Tutorials.rst, unfinished --- TUTORIALS.rst | 60 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index 1727c6726..b66911b23 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -8,33 +8,47 @@ Tutorials * Better way of presenting links: shields.io badges * Put a link of this website: https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb -What is Google Colab? ---------------------- +Jupyter notebook python tutorials +--------------------------------- -Setting-up a local environment to run jupyter notebooks can be a cumbersome step for uninitiated python users. -`Google Colab `_ provides a turnkey coding environment for researchers. -Users can therefore read, execute and collaborate on a code base without leaving the comfort of an internet browser. -The code is executed in the cloud, thus making the code ready-to-use on every operating system that has internet access. +Chemistry, quantum computing and software development is tough stuff. We believe that tutorials in the form of jupyter notebooks are +a great tool to both disseminate knowledge, but also to showcase all the cool stuff the community has done with Tangelo. +Working on notebooks is a great way to contribute to this project, and to show everyone something neat you've worked on: +perhaps something that led to a hardware experiment, or implemented an interesting approach. +If you are new to Jupyter notebooks, check out `this page `_. -Compatible notebooks in Google Colab ------------------------------------- -The compatible notebooks are listed below: +Quickly deploy a notebook in the cloud +-------------------------------------- -* `VQE `_ -* `Custom VQE `_ -* `ADAPT-VQE `_ -* `DMET `_ -* `ONIOM `_ -* `MIFNO `_ -* `Classical Shadows `_ -* `linq/1.the_basics `_ -* `linq/3.noisy_simulation `_ +Sometimes, you don't want to spend time setting up a local python environment. Maybe it's too cumbersome, or maybe it's +just that your computer's performance is not quite as good as what you'd like. Maybe you simply want to run an existing +notebook and try a few things, right now. Or maybe you intend to run a workshop and you want to avoid any delays +incurred by installation issues experienced by your attendees (the worst). Some cloud providers offer services that can +help with that. -However, adapting a new notebook for Google Colab is an easy task. -Installing a package is something possible, and is explained at this `link `_. -For our use case, installing Tangelo can be done with this code cell. +Google colab +^^^^^^^^^^^^ + +Google Colab is a rather straightforward way to achieve the above, as explained on this `webpage `_. +Users can read, execute and collaborate through their internet browser. The notebook is hosted and executed on a machine +in the cloud. There are several subscription tiers: the first one is free and may provide you with what you need. The +others can provide you with access to more performant hardware, including GPUs and TPUs, or extra features. + +Most of our notebooks are ready to be deployed through Google Colab as-is. A few notebooks require dependencies +that are not publicly available (at the time of writing, QEMIST Cloud is not), or are a bit trickier to install: you may +have to contact us to get access to non-public material. + +It is possible that Google Colab is not available in your region of the world. Maybe other cloud providers offer similar +services in your area. + +Setting up your environment through an already-deployed notebook +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you have access to an already-deployed notebook, you can actually make python run shell commands to modify +the environment in which it runs. We use that trick to check right at the start if Tangelo or the other dependencies +for our notebooks are already installed, and install them for you if not. This is what the cell looks like: .. code-block:: python @@ -42,3 +56,7 @@ For our use case, installing Tangelo can be done with this code cell. import tangelo except ModuleNotFoundError: !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet + +You can use pip to install python packages, but you can run any other shell command: use other package managers for other +software and libraries, download data from somewhere else... +`These examples `_ are not specific to Google Colab. From 7b18d0be44f669357b666a9a8f7f54280a21ac5c Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Fri, 19 Aug 2022 11:58:08 -0700 Subject: [PATCH 29/35] Changes to Tutorials.rst, unfinished --- TUTORIALS.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index b66911b23..6f820f487 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -46,16 +46,16 @@ services in your area. Setting up your environment through an already-deployed notebook ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you have access to an already-deployed notebook, you can actually make python run shell commands to modify +If you have access to an already-deployed notebook in a remote environment you have little control on, you can actually make python run shell commands to modify the environment in which it runs. We use that trick to check right at the start if Tangelo or the other dependencies for our notebooks are already installed, and install them for you if not. This is what the cell looks like: -.. code-block:: python +.. code-block:: - try: - import tangelo - except ModuleNotFoundError: - !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet + try: + import tangelo + except ModuleNotFoundError: + !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet You can use pip to install python packages, but you can run any other shell command: use other package managers for other software and libraries, download data from somewhere else... From 49702035b2e6c4bde55287c643d2777dd148bb4c Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Fri, 19 Aug 2022 13:40:44 -0700 Subject: [PATCH 30/35] Added google colab badge to almost every notebook --- examples/adapt.ipynb | 3 +++ examples/classical_shadows.ipynb | 2 ++ examples/dmet.ipynb | 2 ++ examples/linq/1.the_basics.ipynb | 11 +++++++++-- examples/linq/2.qpu_connection.ipynb | 2 ++ examples/linq/3.noisy_simulation.ipynb | 4 +++- examples/mifno.ipynb | 2 ++ examples/oniom.ipynb | 2 ++ examples/overview_endtoend.ipynb | 2 ++ examples/vqe.ipynb | 4 +++- examples/vqe_custom_ansatz_hamiltonian.ipynb | 4 +++- 11 files changed, 33 insertions(+), 5 deletions(-) diff --git a/examples/adapt.ipynb b/examples/adapt.ipynb index 680872b3b..1f4738f5c 100755 --- a/examples/adapt.ipynb +++ b/examples/adapt.ipynb @@ -6,6 +6,9 @@ "source": [ "# ADAPT-VQE\n", "\n", + "\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/adapt.ipynb)\n", + "\n", "ADAPT-VQE was introduced by [Grimsley et al](https://www.nature.com/articles/s41467-019-10988-2) as a solution to the often impracticably deep, and not necessarily accurate, static VQE circuits. In ansatze like UCCSD, one easily reaches the order of thousands of gates, even for modestly sized molecules. In UCCSD and its generalized UCCGSD, the number of fermionic excitations in the ansatz scales like $\\mathcal{O}(N^2M^2)$, and $\\mathcal{O}(N^4)$ respectively. Here $N$ refers to the number of spin-orbitals in the problem basis, and $M$ the number of electrons.\n", ".\n", "\n", diff --git a/examples/classical_shadows.ipynb b/examples/classical_shadows.ipynb index ff6f34a80..168730525 100644 --- a/examples/classical_shadows.ipynb +++ b/examples/classical_shadows.ipynb @@ -6,6 +6,8 @@ "source": [ "# Classical Shadows\n", "\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/classical_shadows.ipynb)\n", + "\n", "The output of a quantum computer is a histogram of measurements, corresponding to the different outcomes observed, usually expressed as bitstrings. The cost and duration of a quantum experiment is roughly linear with the number of shots used to build such histograms, which also correlates with the accuracy of the results. This measurement overhead can be prohibitive for state tomography and computation of observables for quantum chemistry applications.\n", "\n", "The emergent method *classical shadows* ([Nat. Phys. 2020, 16, 1050–1057](https://arxiv.org/abs/2002.08953)) has been developed to mitigate the measurement overhead by offloading quantum tasks to the pre- and post-processing steps. This prediction protocol exhibits logarithmic scaling with the number of terms to measure, in order to compute the expectation value of a term within a given accuracy.\n", diff --git a/examples/dmet.ipynb b/examples/dmet.ipynb index a477ee0ae..a4570fc75 100755 --- a/examples/dmet.ipynb +++ b/examples/dmet.ipynb @@ -11,6 +11,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/dmet.ipynb)\n", + "\n", "This notebook introduces a problem-decomposition technique called DMET (Density-Matrix Embedding Technique), which enables us to break down a molecular systems into a collection of subproblems with lower computational resource requirements.\n", "\n", "Such approaches enable us to study how combining classical and quantum algorithms may play a role in the resolution of problems beyond toy models, and even maybe provide a configurable and scalable path forward in the future, towards much more ambitious molecular systems.\n", diff --git a/examples/linq/1.the_basics.ipynb b/examples/linq/1.the_basics.ipynb index a034f854f..f8c10d381 100755 --- a/examples/linq/1.the_basics.ipynb +++ b/examples/linq/1.the_basics.ipynb @@ -7,6 +7,13 @@ "# Linq: the basics" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/linq/1.the_basics.ipynb)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -871,9 +878,9 @@ ], "metadata": { "kernelspec": { - "display_name": "tangelo_docs_aesthetics", + "display_name": "main_release0.3.1", "language": "python", - "name": "tangelo_docs_aesthetics" + "name": "main_release0.3.1" }, "language_info": { "codemirror_mode": { diff --git a/examples/linq/2.qpu_connection.ipynb b/examples/linq/2.qpu_connection.ipynb index 4d96369fa..cf0b9bc2a 100755 --- a/examples/linq/2.qpu_connection.ipynb +++ b/examples/linq/2.qpu_connection.ipynb @@ -11,6 +11,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/linq/2.qpu_connection.ipynb)\n", + "\n", "This notebook elaborates on how the `tangelo.linq` module can facilitate hardware experiments by integrating the API provided by some hardware providers (IonQ, Honeywell...) or broader quantum cloud services providers such as Azure Quantum or Braket. We essentially provide convenience wrappers to these APIs: the API of your favorite cloud provider is still called underneath, using your own credentials.\n", "\n", "This notebook should be relevant to Tangelo users that prefer to install all the dependencies on their machine, use their own credentials, and be billed directly by the target quantum cloud service(s).\n", diff --git a/examples/linq/3.noisy_simulation.ipynb b/examples/linq/3.noisy_simulation.ipynb index e631842ed..2f7f35e97 100755 --- a/examples/linq/3.noisy_simulation.ipynb +++ b/examples/linq/3.noisy_simulation.ipynb @@ -11,6 +11,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/linq/3.noisy_simulation.ipynb)\n", + "\n", "This notebook assumes that you are familiar with the basics of this package (Gate, Circuit, Translator, Simulator), and focuses on how users can perform noisy simulation on simulators such as cirq, qiskit or qulacs, using a common interface. Users are free to pick between different compute backends, favoring the one with the best performance of most adequate features, and switch between them with minimal changes to their code.\n", "\n", "In particular, we also take the time here to briefly introduce the various quantum error channels supported for the sake of clarity, occasionally sprinkling some (gentle) mathematical equations on top.\n", @@ -562,7 +564,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.9" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/examples/mifno.ipynb b/examples/mifno.ipynb index 8ad3bbf42..e76cc9b8b 100644 --- a/examples/mifno.ipynb +++ b/examples/mifno.ipynb @@ -6,6 +6,8 @@ "source": [ "# Exploring the Method of Increments with QEMIST Cloud and Tangelo\n", "\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/mifno.ipynb)\n", + "\n", "In this notebook, we illustrate how users can leverage QEMIST Cloud and Tangelo to explore the impact of quantum computing on problems tackled with the MI-FNO problem decomposition technique.\n", "\n", "You do not need to have the `qemist-client` python package installed to run this notebook: only `tangelo` is required. For more information about [QEMIST Cloud](https://goodchemistry.com/qemist-cloud/) (installation, features, issues, `qemist_client` API...), please refer to the [QEMIST Cloud documentation](https://alpha-api.qemist.cloud/#/docs) or contact their development team.\n", diff --git a/examples/oniom.ipynb b/examples/oniom.ipynb index 00809f525..30a97e837 100755 --- a/examples/oniom.ipynb +++ b/examples/oniom.ipynb @@ -6,6 +6,8 @@ "source": [ "# ONIOM Problem Decomposition - A use case for an acetic acid molecule in water\n", "\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/oniom.ipynb)\n", + "\n", "## Table of contents:\n", "* [1. Introduction](#1)\n", "* [2. Use case - an acetic acid molecule in water](#2)\n", diff --git a/examples/overview_endtoend.ipynb b/examples/overview_endtoend.ipynb index 73c232845..8fc85b24b 100644 --- a/examples/overview_endtoend.ipynb +++ b/examples/overview_endtoend.ipynb @@ -11,6 +11,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/overview_endtoend.ipynb)\n", + "\n", "Quantum computing is a nascent field, and we have barely started to explore its applications. In order to revolutionize fields such as quantum chemistry, the community has to face challenges in both algorithms design and quantum hardware development. A major undertaking is designing approaches ensuring satisfying accuracy, while keeping computing resource requirements within the capabilities of Noisy Intermediate Scale Quantum (NISQ) devices to solve exciting problems.\n", "\n", "This quantum SDK was designed to support our exploration with this goal in mind, and enables us to build our own end-to-end workflows by providing building-blocks from various toolboxes, and algorithms.\n", diff --git a/examples/vqe.ipynb b/examples/vqe.ipynb index 574106e4f..f80b49a97 100755 --- a/examples/vqe.ipynb +++ b/examples/vqe.ipynb @@ -6,7 +6,9 @@ "source": [ "# VQE with Tangelo\n", "\n", - "The Tangelo Python package provides various toolboxes, which can be leveraged to build quantum chemistry workflows relying on quantum computing. One example of such a workflow is the Variational Quantum Eigensolver (VQE). We provide an implementation of VQE that supports several options, and may provide valuable help in your research and applications.\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/vqe.ipynb)\n", + "\n", + "Tangelo provides various toolboxes, which can be leveraged to build quantum chemistry workflows relying on quantum computing. One example of such a workflow is the Variational Quantum Eigensolver (VQE). We provide an implementation of VQE that supports several options, and may provide valuable help in your research and applications.\n", "\n", "This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, executing the cell below installs the minimal requirements for this notebook." ] diff --git a/examples/vqe_custom_ansatz_hamiltonian.ipynb b/examples/vqe_custom_ansatz_hamiltonian.ipynb index be9f4228c..0b61352c1 100755 --- a/examples/vqe_custom_ansatz_hamiltonian.ipynb +++ b/examples/vqe_custom_ansatz_hamiltonian.ipynb @@ -6,7 +6,9 @@ "source": [ "# Tangelo VQE: Custom Ansatz and qubit Hamiltonian Tutorial\n", "\n", - "The `Tangelo` comes packaged with an implementation of several standard ansatz circuits for the user to take advantage of. In this tutorial, we'll explore how you can incorporate the built in `VQESolver` into your own workflow, by introducing a user-defined custom ansatz circuit and/or a qubit Hamiltonian. We'll base our work here on the `VQESolver` class, and take advantage of tools readily available through the `Tangelo`." + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/goodchemistryco/Tangelo/blob/develop/examples/vqe_custom_ansatz_hamiltonian.ipynb)\n", + "\n", + "Tangelo comes packaged with an implementation of several standard ansatz circuits for the user to take advantage of. In this tutorial, we'll explore how you can incorporate the built in `VQESolver` into your own workflow, by introducing a user-defined custom ansatz circuit and/or a qubit Hamiltonian. We'll base our work here on the `VQESolver` class, and take advantage of tools readily available through Tangelo." ] }, { From eb783728e868dcaad0b569f6ba3e0e5ec07313a6 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Fri, 19 Aug 2022 13:49:06 -0700 Subject: [PATCH 31/35] Added google colab badge to almost every notebook --- TUTORIALS.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index 6f820f487..66861f511 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -31,7 +31,13 @@ help with that. Google colab ^^^^^^^^^^^^ +.. |gcolab| image:: https://colab.research.google.com/assets/colab-badge + +|gcolab| + Google Colab is a rather straightforward way to achieve the above, as explained on this `webpage `_. +If you see |gcolab| link in a notebook, you can just deploy it in Google Colab by just clicking on it. + Users can read, execute and collaborate through their internet browser. The notebook is hosted and executed on a machine in the cloud. There are several subscription tiers: the first one is free and may provide you with what you need. The others can provide you with access to more performant hardware, including GPUs and TPUs, or extra features. From 9512ccdeb4734f71acadcbd30aa531810d6c41e4 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Fri, 19 Aug 2022 13:52:29 -0700 Subject: [PATCH 32/35] test --- TUTORIALS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index 66861f511..bf2b609f5 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -31,7 +31,7 @@ help with that. Google colab ^^^^^^^^^^^^ -.. |gcolab| image:: https://colab.research.google.com/assets/colab-badge +.. |gcolab| image:: https://colab.research.google.com/assets/colab-badge.svg |gcolab| From 20b49e9c6b2cdc9ee93916f834be864a5571cc8a Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Fri, 19 Aug 2022 13:53:39 -0700 Subject: [PATCH 33/35] test --- TUTORIALS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index bf2b609f5..c15ce7fd3 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -36,7 +36,7 @@ Google colab |gcolab| Google Colab is a rather straightforward way to achieve the above, as explained on this `webpage `_. -If you see |gcolab| link in a notebook, you can just deploy it in Google Colab by just clicking on it. +If you see a |gcolab| badge like this one in a notebook, you can just deploy the notebook on Google Colab by just clicking on it. Users can read, execute and collaborate through their internet browser. The notebook is hosted and executed on a machine in the cloud. There are several subscription tiers: the first one is free and may provide you with what you need. The From f7ac33e62f770a89e8da793214b6420cfabb5fb5 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Fri, 19 Aug 2022 13:54:23 -0700 Subject: [PATCH 34/35] test --- TUTORIALS.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index c15ce7fd3..497704c82 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -33,8 +33,6 @@ Google colab .. |gcolab| image:: https://colab.research.google.com/assets/colab-badge.svg -|gcolab| - Google Colab is a rather straightforward way to achieve the above, as explained on this `webpage `_. If you see a |gcolab| badge like this one in a notebook, you can just deploy the notebook on Google Colab by just clicking on it. From 75c45b1421689be2e8ce684230f929b6c38e0306 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Fri, 19 Aug 2022 16:14:02 -0700 Subject: [PATCH 35/35] Drive info --- TUTORIALS.rst | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/TUTORIALS.rst b/TUTORIALS.rst index 497704c82..9dc7ba229 100644 --- a/TUTORIALS.rst +++ b/TUTORIALS.rst @@ -1,13 +1,6 @@ Tutorials ========= -* Intro about Tangelo, potential reach and philosophy of our examples. -* Mention jupyter notebook can be saved in Google Drive. -* Put a figure or an explanation on how to open any notebook from github. -* Talk about nbviewer, https://mybinder.org/? -* Better way of presenting links: shields.io badges -* Put a link of this website: https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb - Jupyter notebook python tutorials --------------------------------- @@ -17,7 +10,7 @@ Working on notebooks is a great way to contribute to this project, and to show e perhaps something that led to a hardware experiment, or implemented an interesting approach. If you are new to Jupyter notebooks, check out `this page `_. - +I hope you enjoy it. Quickly deploy a notebook in the cloud -------------------------------------- @@ -28,12 +21,13 @@ notebook and try a few things, right now. Or maybe you intend to run a workshop incurred by installation issues experienced by your attendees (the worst). Some cloud providers offer services that can help with that. -Google colab + +Google Colab ^^^^^^^^^^^^ .. |gcolab| image:: https://colab.research.google.com/assets/colab-badge.svg -Google Colab is a rather straightforward way to achieve the above, as explained on this `webpage `_. +`Google Colab `_ is a rather straightforward way to achieve the above, as explained on this `webpage `_. If you see a |gcolab| badge like this one in a notebook, you can just deploy the notebook on Google Colab by just clicking on it. Users can read, execute and collaborate through their internet browser. The notebook is hosted and executed on a machine @@ -44,6 +38,10 @@ Most of our notebooks are ready to be deployed through Google Colab as-is. A few that are not publicly available (at the time of writing, QEMIST Cloud is not), or are a bit trickier to install: you may have to contact us to get access to non-public material. +If you also have access to Google Drive, you can upload your notebooks there and just open then in Google Colab by +double-clicking or right-clicking "open with". To enable this, connect Google Drive to Google Colab by +going to the settings (wheel on top-right of screen), clicking "manage apps" and then searching and installing Colab. + It is possible that Google Colab is not available in your region of the world. Maybe other cloud providers offer similar services in your area.