Layer

Layer object which is a collection of operations to be applied on the qubits in the system.

class diskit.components.layer.Layer(operations: Optional[List[CircuitInstruction]] = None, topology: Optional[Topology] = None)

Layer object which is a collection of operations to be applied on the qubits in the system.

add_operation(operation: CircuitInstruction)

Add an operation to the layer.

Parameters

operation (Operation) – Information about the operation to be added in the layer

add_operations(operations: List[CircuitInstruction])

Add multiple operations to the layer.

Parameters

operations (list) – List of Operation objects

non_local_operations()

Check if a control gate is present in the layer between two different computing hosts.

Returns

True if control gate is present between two different computing hosts

Return type

(bool)

property operations

Get the operations in the layer.

Returns

List of Operation objects, which contains information about the operation to

be performed on the quantum circuit.

Return type

(list)

remove_operation(index: int)

Remove an operation from the layer.

Parameters

index (int) – Index of the operation to be removed