{ "cells": [ { "cell_type": "markdown", "metadata": { "tags": [ "remove_cell" ] }, "source": [ "# Exercise Sheet 1: Quantum Logic Gates" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To run this notebook you'll need to [install `qiskit`](https://docs.quantum.ibm.com/guides/install-qiskit), `qiskit-aer` and `qiskit-ibm-runtime`. This can be done in the cell below." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!pip install qiskit\n", "!pip install qiskit-aer\n", "!pip install qiskit-ibm-runtime" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from qiskit import QuantumCircuit, transpile\n", "from qiskit_aer import AerSimulator\n", "from qiskit.visualization import plot_histogram\n", "import numpy as np\n", "\n", "from tests1 import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Overview\n", "## **Exercise 1**\n", "\n", "See 'Part 1' below, and find and complete the circuits required for the:\n", "* (a) `XOR` gate;\n", "* (b) `AND` gate;\n", "* (c) `NAND` gate;\n", "* (d) `OR` gate.\n", "\n", "'Part 2' below is for your own interest, where you will find a `layout` for which the AND gate compiles to 6 non-local gates for `Manila`. Note that there is some randomness in the compiling process. So you might need to try a few times. Feel free to transipile the other gates you have designed. \n", "\n", "## **Excercise 2** \n", "Answers Code showing various properties of foundational operations such as the Pauli gates/matrices and the Hadamard gate/matrix and some practice on alternative bases. \n", "* 1) (a)(b) Alternative Pauli Basis States\n", "* 2) (a)(b)(c)(d) Properties of Pauli Matrices\n", "* 3) (a)(b)(c) The Hadamard" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Exercise 1\n", "
📓 Assign your choice of layout to the list variable layout in the cell below