InstructionSet
QuICT.core.virtual_machine.InstructionSet ¶
InstructionSet(two_qubit_gate: GateType, one_qubit_gates: List[GateType], one_qubit_rule: Union[str, callable] = None)
Bases: object
InstructionSet describes a set of gates(expectly to be universal set)
Instruction Set contains gates and some rules, which can be assigned by user.
Attributes:
-
two_qubit_gate(GateType) –the type of the two_qubit_gate
-
one_qubit_gates(list<GateType>) –the types of the one_qubit_gate
-
one_qubit_gates_fidelity(Union[float, Dict, List]) –The fidelity for single qubit quantum gate. Defaults to None.
-
one_qubit_rule(Union[str, callable]) –rules to transform SU(2) into instruction set
Source code in QuICT/core/virtual_machine/instruction_set.py
one_qubit_rule
property
¶
the rule of decompose 2*2 unitary into target gates
If not assigned by the register_one_qubit_rule method, some pre-implemented method would be chosen corresponding to the one_qubit_gates. An Exception will be raised when no method is chosen.
Returns:
-
callable–the corresponding rule
register_one_qubit_rule ¶
register one-qubit gate decompostion rule
Parameters:
-
one_qubit_rule(callable)–decompostion rule, you can define your self rule function or use one of [zyz_rule, zxz_rule, hrz_rule, xyx_rule, ibmq_rule, u3_rule].
Source code in QuICT/core/virtual_machine/instruction_set.py
register_two_qubit_rule_map ¶
register rule which transforms from source gate into target gate
Parameters:
-
two_qubit_rule(callable)–the transform rule
-
source(GateType)–the type of source gate
Source code in QuICT/core/virtual_machine/instruction_set.py
select_transform_rule ¶
choose a rule which transforms source gate into target gate(2-qubit)
Parameters:
-
source(GateType)–the type of source gate
Returns:
-
callable–the transform rules