Circuit#

class discopy.quantum.tk.Circuit(*args, **kwargs)[source]#

Bases: Circuit

Extend pytket.Circuit with counts post-processing.

static upgrade(tk_circuit)[source]#

Takes a pytket.Circuit, returns a Circuit.

property n_bits#

Number of bits in a circuit.

add_bit(unit, offset=None)[source]#

Add a bit, update post_processing.

rename_units(renaming)[source]#

Rename units in a circuit.

scale(number)[source]#

Scale a circuit by a given number.

post_select(post_selection)[source]#

Post-select bits on a a given value.

post_process(process)[source]#

Classical post-processing.

get_counts(*others, backend=None, **params)[source]#

Runs a circuit on a backend and returns the counts.