loom.eka.operations.logical_operation

Copyright 2024 Entropica Labs Pte Ltd

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class loom.eka.operations.logical_operation.CNOT(*args, **kwargs)[source]

Bases: LogicalOperation

Describes a CNOT gate between two logical qubits.

Parameters:
  • control_qubit (str) – Name of the control logical qubit.

  • target_qubit (str) – Name of the target logical qubit.

control_qubit: str
target_qubit: str
class loom.eka.operations.logical_operation.Hadamard(*args, **kwargs)[source]

Bases: LogicalOperation

Describes a Hadamard gate on a logical qubit.

Parameters:

target_qubit (str) – Name of the target logical qubit.

target_qubit: str
class loom.eka.operations.logical_operation.LogicalOperation(*args, **kwargs)[source]

Bases: Operation

Parent class for all logical operations in the Eka. All logical operations acts on logical qubits. Details of implementation are abstracted away, including how the qubits are constructed. E.g. they may be constructed from multiple blocks with a single qubit each, or from a single block with multiple qubits.

Note that these operations only modify the state of the logical qubits, they do not perform any code level operations like making sure the structure of the code is preserved (e.g. a block ends up being rotated).

class loom.eka.operations.logical_operation.Phase(*args, **kwargs)[source]

Bases: LogicalOperation

Describes a Phase gate on a logical qubit.

Parameters:

target_qubit (str) – Name of the target logical qubit.

target_qubit: str
class loom.eka.operations.logical_operation.PhaseInverse(*args, **kwargs)[source]

Bases: LogicalOperation

Describes an inverse Phase gate on a logical qubit.

Parameters:

target_qubit (str) – Name of the target logical qubit.

target_qubit: str
class loom.eka.operations.logical_operation.Reset(*args, **kwargs)[source]

Bases: LogicalOperation

Reset a logical qubit to one of the supported states.

Parameters:
state: SingleQubitPauliEigenstate
target_qubit: str
class loom.eka.operations.logical_operation.T(*args, **kwargs)[source]

Bases: LogicalOperation

Describes a T gate on a logical qubit.

Parameters:

target_qubit (str) – Name of the target logical qubit.

target_qubit: str
class loom.eka.operations.logical_operation.X(*args, **kwargs)[source]

Bases: LogicalOperation

Describes an X gate on a logical qubit.

Parameters:

target_qubit (str) – Name of the target logical qubit.

target_qubit: str
class loom.eka.operations.logical_operation.Y(*args, **kwargs)[source]

Bases: LogicalOperation

Describes a Y gate on a logical qubit.

Parameters:

target_qubit (str) – Name of the target logical qubit.

target_qubit: str
class loom.eka.operations.logical_operation.Z(*args, **kwargs)[source]

Bases: LogicalOperation

Describes a Z gate on a logical qubit.

Parameters:

target_qubit (str) – Name of the target logical qubit.

target_qubit: str