{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Introduction: Getting Started\n", "***" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Building a circuit\n", "Creating a circuit is exactly similar to the qiskit. Almost exact same command can be used as shown in the [tutorial](https://github.com/Qiskit/qiskit-tutorials/blob/master/qiskit/terra/quantum_circuits.ipynb). Few examples are given below." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Example 1 : Qubits and Classical bits" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "q1_0: |0>\n", " \n", "q1_1: |0>\n", " \n", " c1_0: 0 \n", " \n", " c1_1: 0 \n", "" ], "text/plain": [ "
┌───┐ \n", "q2_0: |0>┤ S ├──■───────\n", " └───┘┌─┴─┐┌───┐\n", "q2_1: |0>─────┤ X ├┤ H ├\n", " └───┘└───┘" ], "text/plain": [ "
┌───┐ \n", "q_0: |0>┤ S ├──■───────\n", " └───┘┌─┴─┐┌───┐\n", "q_1: |0>─────┤ X ├┤ H ├\n", " └───┘└───┘" ], "text/plain": [ "
┌───┐ ░ ┌──────────┐ ┌─┐ \n", "q_0: |0>┤ S ├──■────────░─┤ U1(3.14) ├──■──┤M├───\n", " └───┘┌─┴─┐┌───┐ ░ └──────────┘┌─┴─┐└╥┘┌─┐\n", "q_1: |0>─────┤ X ├┤ H ├─░─────────────┤ X ├─╫─┤M├\n", " └───┘└───┘ ░ └───┘ ║ └╥┘\n", " c_0: 0 ════════════════════════════════════╩══╬═\n", " ║ \n", " c_1: 0 ═══════════════════════════════════════╩═\n", "" ], "text/plain": [ "