CircuitRegion

class CircuitRegion(intervals)[source]

Bases: Mapping[int, CycleInterval]

The CircuitRegion class.

A CircuitRegion is an contiguous, convex area in a circuit. It is represented as a map from qudit indices to cycle intervals.

__init__(intervals)[source]

CircuitRegion Initializer.

Parameters:

intervals (Mapping[int, IntervalLike]) – A map from qudit indices to cycle intervals. The cycle intervals can be given as either a CycleInterval object or a tuple of two ints that represent the lower and upper bound of the inclusive interval.

Notes

All cycle intervals are inclusive.

Attributes

empty

Return true if this region is empty.

location

Return the qudits this region includes as a CircuitLocation.

max_cycle

Return the largest cycle index for any qudit.

max_min_cycle

Return the largest cycle index for any lower bound.

max_qudit

Return the largest qudit index.

min_cycle

Return the smallest cycle index for any qudit.

min_max_cycle

Return the smallest cycle index for any upper bound.

min_qudit

Return the smallest qudit index.

points

Return the points described by this region.

volume

Return the volume of this region measured in qudit-cycles.

width

Return the number of cycles this region participates in.

Methods

dependency(other)

Return 1 if self depends on other.

depends_on(other)

Return true if self depends on other.

get(k[,d])

intersection(other)

is_region(region)

Return true if region is a CircuitRegionLike.

items()

keys()

overlaps(other)

Return true if other overlaps this region.

shift_left(amount_to_shift)

Shift the region to the left by amount_to_shift.

shift_right(amount_to_shift)

Shift the region to the right by amount_to_shift.

transpose()

Flip region to map cycle indices to qudit indices.

union(other)

values()