Operation

exception interlinq.objects.operation.InputError(message)

Exception raised for errors in the input.

expression -- input expression in which the error occurred
message -- explanation of the error
class interlinq.objects.operation.Operation(name: str, qids: Optional[list] = None, cids: Optional[list] = None, gate: Optional[str] = None, gate_param: Optional[list] = None, computing_host_ids: list = [], pre_allocated_qubits: bool = False)

Operation object which contains information about the quantum operation or a quantum gate which is to be applied to a circuit

property computing_host_ids

Get the computing_host_ids associated to the operation

Returns

List of associated ID/IDS of the computing host where the operation/gate

is being performed. The first computing host in the list would be the one where the operation is being performed.

Return type

(list)

property gate

Get the gate associated to the operation, if any

Returns

Name of the single or the two-qubit gate

Return type

(str)

property gate_param

Get the gate_param associated to the operation, if any

Returns

parameter for rotational gates

Return type

(list)

get_control_host()

Get the ID of the host with the control qubit, in case of TWO_QUBIT operations

Returns

ID of the control qubit associated to the two qubit operation

Return type

(str)

get_control_qubit()

Get the ID of the control qubit, in case of TWO_QUBIT operations

Returns

ID of the control qubit associated to the two qubit operation

Return type

(str)

get_dict()

Return the Operation object in a dictionary format

get_target_host()

Get the ID of the host with the target qubit, in case of TWO_QUBIT operations

Returns

ID of the target qubit associated to the two qubit operation

Return type

(str)

get_target_qubit()

Get the ID of the target qubit, in case of TWO_QUBIT operations

Returns

ID of the target qubit associated to the two qubit operation

Return type

(str)

is_control_gate_over_two_hosts()

Check if the operation is a control gate over two different computing hosts

Returns

Bool value, which is true if the operation is a control gate over two

different computing hosts

Return type

(bool)

property name

Get the name of the operation

Returns

Name of the operation

Return type

(str)

property qids

Get the qid or the IDs of the qubits associated to the operation

Returns

List of qubit IDs

Return type

(list)