# QCA Layout

A QCA layout places QCA cells on a Cartesian grid with a ground layer and a crossing layer. Each cell has a type, a
mode as known from QCADesigner (regular, rotated, via, or crossover), and, for inputs and outputs, a name. Clock zones
are tiles of cells, and each clock zone can be a synchronization element that extends its Hold phase. See
[Cell Grids and Tile Clocking](../../layouts/cell_grid.html.md) for the cell storage and the clock zones that QCA shares with other technologies.

A QCA layout can be obtained from a gate-level layout by applying the [QCA ONE library](../../physical_design/apply_gate_library.html.md#apply-gate-library).

### C++

**Header:** `fiction/technology/qca/layout.hpp`

### enum class [fiction](../../layouts/traits.html.md#_CPPv47fiction)::qca::cell_type : uint8_t

Types of Quantum-dot Cellular Automata (QCA) cells. The enumerators carry the symbols of their ASCII representation. 

*Values:*

### enumerator EMPTY

No cell. 

### enumerator NORMAL

Regular cell. 

### enumerator INPUT

Primary input cell. 

### enumerator OUTPUT

Primary output cell. 

### enumerator CONST_0

Cell with a fixed polarization of logic 0. 

### enumerator CONST_1

Cell with a fixed polarization of logic 1. 

### enum class [fiction](../../layouts/traits.html.md#_CPPv47fiction)::qca::cell_mode : uint8_t

Modes of QCA cells as known from QCADesigner. 

*Values:*

### enumerator NORMAL

Regular cell. 

### enumerator ROTATED

Cell rotated by 45°. 

### enumerator VERTICAL

Via cell that connects the ground and the crossing layer. 

### enumerator CROSSOVER

Cell of a multilayer crossing. 

### constexpr bool [fiction](../../layouts/traits.html.md#_CPPv47fiction)::qca::is_constant(const [cell_type](#_CPPv4N7fiction3qca9cell_typeE) ct) noexcept

Whether a QCA cell has a fixed polarization.

* **Parameters:**
  **ct** – Cell type. 
* **Returns:**
  `true` iff `ct` is `CONST_0` or `CONST_1`. 

### class layout : public [fiction](../../layouts/traits.html.md#_CPPv47fiction)::[layouts](../../layouts/traits.html.md#_CPPv4N7fiction7layoutsE)::[cell_grid](../../layouts/cell_grid.html.md#_CPPv4I0EN7fiction7layouts9cell_gridE)<[cell_type](#_CPPv4N7fiction3qca9cell_typeE)>, public [fiction](../../layouts/traits.html.md#_CPPv47fiction)::[layouts](../../layouts/traits.html.md#_CPPv4N7fiction7layoutsE)::[tile_clocking](../../layouts/cell_grid.html.md#_CPPv4N7fiction7layouts13tile_clockingE)

A QCA layout: QCA cells on a Cartesian grid with a ground layer (`z = 0`) and crossing layers (`z > 0`). Cells carry a type, a mode, and, for inputs and outputs, a name. Clock zones are tiles of cells, and each clock zone can be a synchronization element that extends its Hold phase. The layout has value semantics; copies are independent. 

### Public Types

### using sync_elem_t = [layouts](../../layouts/traits.html.md#_CPPv4N7fiction7layoutsE)::clocking::[state](../../layouts/clocking_state.html.md#_CPPv4N7fiction7layouts8clocking5stateE)::[sync_elem_t](../../layouts/clocking_state.html.md#_CPPv4N7fiction7layouts8clocking5state11sync_elem_tE)

Hold-phase extension in full clock cycles. 

### Public Functions

### inline explicit layout(const extent &size = {}, std::string name = "", const uint16_t tile_size_x = 1u, const uint16_t tile_size_y = 1u)

Creates an empty layout with open clocking.

* **Parameters:**
  * **size** – Half-open cell sizes; layers beyond the ground layer hold crossing cells. 
  * **name** – Layout name. 
  * **tile_size_x** – Clock-zone width in cells. 
  * **tile_size_y** – Clock-zone height in cells. 
* **Throws:**
  std::invalid_argument – If a size exceeds the coordinate domain or a clock-zone size is zero. 

### inline layout(const extent &size, const clocking_scheme_t &scheme, std::string name = "", const uint16_t tile_size_x = 1u, const uint16_t tile_size_y = 1u)

Creates an empty layout clocked by the given scheme.

* **Parameters:**
  * **size** – Half-open cell sizes; layers beyond the ground layer hold crossing cells. 
  * **scheme** – Clocking scheme over clock zones. 
  * **name** – Layout name. 
  * **tile_size_x** – Clock-zone width in cells. 
  * **tile_size_y** – Clock-zone height in cells. 
* **Throws:**
  std::invalid_argument – If a size exceeds the coordinate domain or a clock-zone size is zero. 

### inline bool operator==(const [layout](#_CPPv4N7fiction3qca6layoutE) &other) const noexcept

Compares two layouts: same cells, names, modes, tile size, and clocking scheme name.

* **Parameters:**
  **other** – Right-hand side layout. 
* **Returns:**
  `true` iff both layouts are identical. 

### inline void assign_cell_type(const [cell](../../layouts/traits.html.md#_CPPv4I0EN7fiction4cellE) &c, const [cell_type](#_CPPv4N7fiction3qca9cell_typeE) ct)

Assigns a cell type to a position. Assigning `EMPTY` removes the cell with its name and mode.

* **Parameters:**
  * **c** – Cell position. 
  * **ct** – Cell type. 

### inline void assign_cell_mode(const [cell](../../layouts/traits.html.md#_CPPv4I0EN7fiction4cellE) &c, const [cell_mode](#_CPPv4N7fiction3qca9cell_modeE) m)

Assigns a mode to a cell. `cell_mode::NORMAL` removes a stored mode.

* **Parameters:**
  * **c** – Cell position. 
  * **m** – Cell mode. 

### inline [cell_mode](#_CPPv4N7fiction3qca9cell_modeE) get_cell_mode(const [cell](../../layouts/traits.html.md#_CPPv4I0EN7fiction4cellE) &c) const noexcept

The mode of a cell.

* **Parameters:**
  **c** – Cell position. 
* **Returns:**
  Mode of the cell at `c`, `cell_mode::NORMAL` if none is stored. 

### inline void assign_synchronization_element(const clock_zone &cz, const [sync_elem_t](#_CPPv4N7fiction3qca6layout11sync_elem_tE) se)

Turns a clock zone into a synchronization element.

* **Parameters:**
  * **cz** – Clock zone. 
  * **se** – Number of full clock cycles to extend the Hold phase of `cz` by; 0 turns `cz` back into a normal clock zone. 
* **Throws:**
  std::bad_alloc – If allocation fails. 

### inline bool is_synchronization_element(const [cell](../../layouts/traits.html.md#_CPPv4I0EN7fiction4cellE) &c) const noexcept

Whether the clock zone that contains a cell is a synchronization element.

* **Parameters:**
  **c** – Cell position. 
* **Returns:**
  `true` iff `get_clock_zone(c)` is a synchronization element. 

### inline [sync_elem_t](#_CPPv4N7fiction3qca6layout11sync_elem_tE) get_synchronization_element(const [cell](../../layouts/traits.html.md#_CPPv4I0EN7fiction4cellE) &c) const noexcept

The Hold-phase extension of the clock zone that contains a cell.

* **Parameters:**
  **c** – Cell position. 
* **Returns:**
  Hold-phase extension of `get_clock_zone(c)` in full clock cycles. 

### inline uint32_t num_se() const noexcept

Number of synchronization elements.

* **Returns:**
  Number of clock zones with a nonzero Hold-phase extension. 

### Public Static Attributes

### static constexpr double CELL_WIDTH = 18.0

Cell width in nm, the QCADesigner default. 

### static constexpr double CELL_HEIGHT = 18.0

Cell height in nm, the QCADesigner default. 

### static constexpr double CELL_HSPACE = 2.0

Horizontal spacing between two cells in nm, the QCADesigner default. 

### static constexpr double CELL_VSPACE = 2.0

Vertical spacing between two cells in nm, the QCADesigner default. 

### Python

### *class* qca_cell_type(\*values)

Types of Quantum-dot Cellular Automata (QCA) cells. The enumerators
carry the symbols of their ASCII representation.

#### EMPTY *= 32*

#### NORMAL *= 120*

#### INPUT *= 105*

#### OUTPUT *= 111*

#### CONST_0 *= 48*

#### CONST_1 *= 49*

### *class* qca_cell_mode(\*values)

Modes of QCA cells as known from QCADesigner.

#### NORMAL *= 0*

#### ROTATED *= 1*

#### VERTICAL *= 2*

#### CROSSOVER *= 3*

### *class* qca_layout

### *class* qca_layout(extent: [extent](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.extent) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)])

### *class* qca_layout(extent: [extent](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.extent) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)], clocking_scheme: [str](https://docs.python.org/3/builtins/stdtypes.html#str) = '2DDWave', layout_name: [str](https://docs.python.org/3/builtins/stdtypes.html#str) = '', tile_size_x: [int](https://docs.python.org/3/builtins/functions.html#int) = 1, tile_size_y: [int](https://docs.python.org/3/builtins/functions.html#int) = 1)

A QCA layout: QCA cells on a Cartesian grid with a ground layer (`z = 0`) and crossing layers (`z > 0`). Cells carry a type, a mode, and,
for inputs and outputs, a name. Clock zones are tiles of cells, and
each clock zone can be a synchronization element that extends its Hold
phase. The layout has value semantics; copies are independent.

#### assign_cell_mode(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)], m: [qca_cell_mode](#mnt.pyfiction.qca.qca_cell_mode)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Assigns a mode to a cell. `cell_mode::NORMAL` removes a stored mode.

* **Parameters:**
  * **c** – Cell position.
  * **m** – Cell mode.

#### assign_cell_name(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)], n: [str](https://docs.python.org/3/builtins/stdtypes.html#str)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Assigns a name to a cell. The empty string removes the name.

* **Parameters:**
  * **c** – Cell position.
  * **n** – Cell name.

#### assign_cell_type(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)], ct: [qca_cell_type](#mnt.pyfiction.qca.qca_cell_type)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Assigns a cell type to a position. Assigning `EMPTY` removes the cell
with its name and mode.

* **Parameters:**
  * **c** – Cell position.
  * **ct** – Cell type.

#### assign_clock_number(cz: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)], cn: [int](https://docs.python.org/3/builtins/functions.html#int)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Overrides the clock number of a clock zone.

* **Parameters:**
  * **cz** – Clock zone.
  * **cn** – Clock number.
* **Raises:**
  [**MemoryError**](https://docs.python.org/3/builtins/exceptions.html#MemoryError) – If allocation fails.

#### assign_synchronization_element(cz: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)], se: [int](https://docs.python.org/3/builtins/functions.html#int)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Turns a clock zone into a synchronization element.

* **Parameters:**
  * **cz** – Clock zone.
  * **se** – Number of full clock cycles to extend the Hold phase of `cz`
    by; 0 turns `cz` back into a normal clock zone.
* **Raises:**
  [**MemoryError**](https://docs.python.org/3/builtins/exceptions.html#MemoryError) – If allocation fails.

#### bounding_box() → [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [None](https://docs.python.org/3/builtins/constants.html#None), [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [None](https://docs.python.org/3/builtins/constants.html#None)]

Returns the minimum and maximum corner of the bounding box.
A 2D bounding box object computes a minimum-sized box around all
non-empty coordinates in a given layout. Layouts can be of arbitrary
size and, thus, may be larger than their contained elements.
Sometimes, it might be necessary to know exactly which space the
associated layout internals occupy. A bounding box computes
coordinates that span a minimum-sized rectangle that encloses all non-
empty layout coordinates.

* **Returns:**
  The minimum  and maximum enclosing coordinate in the associated layout.

#### cells() → [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate)]

Returns the positions of all cells, in unspecified order.

#### get_cell_mode(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [qca_cell_mode](#mnt.pyfiction.qca.qca_cell_mode)

The mode of a cell.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  Mode of the cell at `c`, `cell_mode::NORMAL` if none is stored.

#### get_cell_name(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [str](https://docs.python.org/3/builtins/stdtypes.html#str)

The name of a cell.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  Name of the cell at `c`, or the empty string if it has none.

#### get_cell_type(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [qca_cell_type](#mnt.pyfiction.qca.qca_cell_type)

The cell type at a position.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  Cell type at `c`, `EMPTY` if no cell is there.

#### get_clock_number(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [int](https://docs.python.org/3/builtins/functions.html#int)

The clock number of the clock zone that contains a cell.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  Clock number of `get_clock_zone(c)`.

#### get_clock_zone(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate)

The clock zone that contains a cell: its tile on layer 0. Negative
axes use floor division.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  Clock zone of `c`.

#### get_clocking_scheme_name() → [str](https://docs.python.org/3/builtins/stdtypes.html#str)

Returns the name of the layout’s clocking scheme, e.g., `2DDWave` or `USE`.

#### get_layout_name() → [str](https://docs.python.org/3/builtins/stdtypes.html#str)

The layout name.

* **Returns:**
  Layout name.

#### get_synchronization_element(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [int](https://docs.python.org/3/builtins/functions.html#int)

The Hold-phase extension of the clock zone that contains a cell.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  Hold-phase extension of `get_clock_zone(c)` in full clock cycles.

#### get_tile_size_x() → [int](https://docs.python.org/3/builtins/functions.html#int)

Tile width in cells.

* **Returns:**
  Tile width.

#### get_tile_size_y() → [int](https://docs.python.org/3/builtins/functions.html#int)

Tile height in cells.

* **Returns:**
  Tile height.

#### is_clocking_scheme(name: [str](https://docs.python.org/3/builtins/stdtypes.html#str)) → [bool](https://docs.python.org/3/builtins/functions.html#bool)

Compares the clocking scheme against a name. Predefined names are
constants in `fiction::layouts::clocking`.

* **Parameters:**
  **name** – Clocking scheme name.
* **Returns:**
  `true` iff the scheme is called `name`.

#### is_empty() → [bool](https://docs.python.org/3/builtins/functions.html#bool)

Whether the grid holds no cell.

* **Returns:**
  `true` iff there is no cell.

#### is_empty_cell(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [bool](https://docs.python.org/3/builtins/functions.html#bool)

Whether no cell sits at a position.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  `true` iff `c` holds no cell.

#### is_pi(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [bool](https://docs.python.org/3/builtins/functions.html#bool)

Whether a cell is a primary input, i.e., of type `INPUT`.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  `true` iff `c` holds an input cell.

#### is_po(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [bool](https://docs.python.org/3/builtins/functions.html#bool)

Whether a cell is a primary output, i.e., of type `OUTPUT`.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  `true` iff `c` holds an output cell.

#### is_regularly_clocked() → [bool](https://docs.python.org/3/builtins/functions.html#bool)

Whether a regular scheme clocks the layout with no overridden zones.

* **Returns:**
  `true` iff the clocking is regular.

#### is_synchronization_element(c: [coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate) | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)] | [tuple](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int), [int](https://docs.python.org/3/builtins/functions.html#int)]) → [bool](https://docs.python.org/3/builtins/functions.html#bool)

Whether the clock zone that contains a cell is a synchronization
element.

* **Parameters:**
  **c** – Cell position.
* **Returns:**
  `true` iff `get_clock_zone(c)` is a synchronization element.

#### num_cells() → [int](https://docs.python.org/3/builtins/functions.html#int)

Number of cells.

* **Returns:**
  Number of cells.

#### num_clocks() → [int](https://docs.python.org/3/builtins/functions.html#int)

Number of clock phases.

* **Returns:**
  Number of clock phases.

#### num_pis() → [int](https://docs.python.org/3/builtins/functions.html#int)

Number of primary input cells.

* **Returns:**
  Number of input cells.

#### num_pos() → [int](https://docs.python.org/3/builtins/functions.html#int)

Number of primary output cells.

* **Returns:**
  Number of output cells.

#### num_se() → [int](https://docs.python.org/3/builtins/functions.html#int)

Number of synchronization elements.

* **Returns:**
  Number of clock zones with a nonzero Hold-phase extension.

#### pis() → [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate)]

Returns the positions of all input cells, in unspecified order.

#### pos() → [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[coordinate](../../layouts/coordinates.html.md#mnt.pyfiction.layouts.coordinate)]

Returns the positions of all output cells, in unspecified order.

#### replace_clocking_scheme(name: [str](https://docs.python.org/3/builtins/stdtypes.html#str)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Replaces the clocking scheme by the predefined scheme of the given name. Clock-number overrides are discarded. Raises ValueError for an unknown name.

#### set_layout_name(name: [str](https://docs.python.org/3/builtins/stdtypes.html#str)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Sets the layout name.

* **Parameters:**
  **name** – Layout name.

#### set_tile_size_x(size: [int](https://docs.python.org/3/builtins/functions.html#int)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Sets the tile width.

* **Parameters:**
  **size** – Tile width in cells.
* **Raises:**
  [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError) – if `size` is zero.

#### set_tile_size_y(size: [int](https://docs.python.org/3/builtins/functions.html#int)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Sets the tile height.

* **Parameters:**
  **size** – Tile height in cells.
* **Raises:**
  [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError) – if `size` is zero.
