Circuit Plot

Matplotlib based plotting of quantum circuits.

Todo:

  • Optimize printing of large circuits.
  • Get this to work with single gates.
  • Do a better job checking the form of circuits to make sure it is a Mul of Gates.
  • Get multi-target gates plotting.
  • Get initial and final states to plot.
  • Get measurements to plot. Might need to rethink measurement as a gate issue.
  • Get scale and figsize to be handled in a better way.
  • Write some tests/examples!
sympy.physics.quantum.circuitplot.labeller(n, symbol='q')[source]

Autogenerate labels for wires of quantum circuits.

Parameters :

n : int

number of qubits in the circuit

symbol : string

A character string to precede all gate labels. E.g. ‘q_0’, ‘q_1’, etc.

>>> from sympy.physics.quantum.circuitplot import labeller :

>>> labeller(2) :

[‘q_1’, ‘q_0’] :

>>> labeller(3,’j’) :

[‘j_2’, ‘j_1’, ‘j_0’] :

class sympy.physics.quantum.circuitplot.Mz[source]

Mock-up of a z measurement gate.

This is in circuitplot rather than gate.py because it’s not a real gate, it just draws one.

class sympy.physics.quantum.circuitplot.Mx[source]

Mock-up of an x measurement gate.

This is in circuitplot rather than gate.py because it’s not a real gate, it just draws one.

sympy.physics.quantum.circuitplot.CreateCGate(name, latexname=None)[source]

Use a lexical closure to make a controlled gate.

Previous topic

State

Next topic

Gates

This Page