sf.circuitdrawer.Circuit

class Circuit(wires)[source]

Bases: object

Represents a quantum circuit that can be compiled to tex format.

Parameters

wires (int) – the number of quantum wires or subsystems to use in the circuit diagram.

compile_document([tex_dir])

Compiles latex documents.

dump_to_document()

Writes current circuit to document.

parse_op(op)

Transforms a Strawberry Fields operator object to a latex qcircuit gate.

compile_document(tex_dir='./circuit_tex')[source]

Compiles latex documents.

Parameters

tex_dir (str) – relative directory for latex document output.

Returns

the file path of the resulting latex document.

Return type

str

dump_to_document()[source]

Writes current circuit to document.

Returns

latex document string.

Return type

str

parse_op(op)[source]

Transforms a Strawberry Fields operator object to a latex qcircuit gate.

Parameters

op (strawberryfields.ops.Gate) – the Strawberry Fields operator object.

Raises