{ "metadata": { "name": "sympy_quantum_computing" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Basic Symbolic Quantum Mechanics with [SymPy](http://sympy.org)\n", "\n", "We first load the IPython extensions that enable LaTeX-based mathematical printing \n", "of SymPy objects, and then import the quantum computing libraries from SymPy." ] }, { "cell_type": "code", "collapsed": true, "input": [ "%load_ext sympyprinting" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": true, "input": [ "from sympy import sqrt, symbols, Rational\n", "from sympy import expand, Eq, Symbol, simplify, exp, sin\n", "from sympy.physics.quantum import *\n", "from sympy.physics.quantum.qubit import *\n", "from sympy.physics.quantum.gate import *\n", "from sympy.physics.quantum.grover import *\n", "from sympy.physics.quantum.qft import QFT, IQFT, Fourier\n", "from sympy.physics.quantum.circuitplot import circuit_plot" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": {}, "source": [ "