Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'swap': QasmBuiltinGate('swap', [], ['c', 't']),
'ccx': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
'toffoli': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
# TODO: These gates are not defined in qelib1, but defined in language specifications.
'U': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'CX': QasmBuiltinGate('cx', [], ['c', 't'])
})
gates.update({
'x': QasmBuiltinGate('x', [], ['t']),
'y': QasmBuiltinGate('y', [], ['t']),
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'swap': QasmBuiltinGate('swap', [], ['c', 't']),
'ccx': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
'toffoli': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
# TODO: These gates are not defined in qelib1, but defined in language specifications.
'U': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'CX': QasmBuiltinGate('cx', [], ['c', 't'])
})
'x': QasmBuiltinGate('x', [], ['t']),
'y': QasmBuiltinGate('y', [], ['t']),
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'swap': QasmBuiltinGate('swap', [], ['c', 't']),
'ccx': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
'toffoli': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
# TODO: These gates are not defined in qelib1, but defined in language specifications.
'U': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'CX': QasmBuiltinGate('cx', [], ['c', 't'])
})
def load_qelib1(gates: Dict[str, QasmAbstractGate]) -> None:
# TODO: Use circuit.GATE_SET.
gates.update({
'x': QasmBuiltinGate('x', [], ['t']),
'y': QasmBuiltinGate('y', [], ['t']),
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'swap': QasmBuiltinGate('swap', [], ['c', 't']),
'ccx': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
def load_qelib1(gates: Dict[str, QasmAbstractGate]) -> None:
# TODO: Use circuit.GATE_SET.
gates.update({
'x': QasmBuiltinGate('x', [], ['t']),
'y': QasmBuiltinGate('y', [], ['t']),
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'swap': QasmBuiltinGate('swap', [], ['c', 't']),
'ccx': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
'toffoli': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
# TODO: These gates are not defined in qelib1, but defined in language specifications.
'U': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
def load_qelib1(gates: Dict[str, QasmAbstractGate]) -> None:
# TODO: Use circuit.GATE_SET.
gates.update({
'x': QasmBuiltinGate('x', [], ['t']),
'y': QasmBuiltinGate('y', [], ['t']),
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'y': QasmBuiltinGate('y', [], ['t']),
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'swap': QasmBuiltinGate('swap', [], ['c', 't']),
'ccx': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
'toffoli': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
# TODO: These gates are not defined in qelib1, but defined in language specifications.
'U': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'CX': QasmBuiltinGate('cx', [], ['c', 't'])
})
def load_qelib1(gates: Dict[str, QasmAbstractGate]) -> None:
# TODO: Use circuit.GATE_SET.
gates.update({
'x': QasmBuiltinGate('x', [], ['t']),
'y': QasmBuiltinGate('y', [], ['t']),
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
def load_qelib1(gates: Dict[str, QasmAbstractGate]) -> None:
# TODO: Use circuit.GATE_SET.
gates.update({
'x': QasmBuiltinGate('x', [], ['t']),
'y': QasmBuiltinGate('y', [], ['t']),
'z': QasmBuiltinGate('z', [], ['t']),
'h': QasmBuiltinGate('h', [], ['t']),
't': QasmBuiltinGate('t', [], ['t']),
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'swap': QasmBuiltinGate('swap', [], ['c', 't']),
'ccx': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
'toffoli': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
# TODO: These gates are not defined in qelib1, but defined in language specifications.
'tdg': QasmBuiltinGate('tdg', [], ['t']),
's': QasmBuiltinGate('s', [], ['t']),
'sdg': QasmBuiltinGate('sdg', [], ['t']),
'cx': QasmBuiltinGate('cx', [], ['c', 't']),
'cz': QasmBuiltinGate('cz', [], ['c', 't']),
'cnot': QasmBuiltinGate('cnot', [], ['c', 't']),
'rx': QasmBuiltinGate('rx', ['theta'], ['t']),
'ry': QasmBuiltinGate('ry', ['theta'], ['t']),
'rz': QasmBuiltinGate('rz', ['theta'], ['t']),
'phase': QasmBuiltinGate('rz', ['theta'], ['t']),
'u1': QasmBuiltinGate('u1', ['lambda'], ['t']),
'u2': QasmBuiltinGate('u2', ['phi', 'lambda'], ['t']),
'u3': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'cu1': QasmBuiltinGate('cu1', ['lambda'], ['c', 't']),
'cu2': QasmBuiltinGate('cu2', ['phi', 'lambda'], ['c', 't']),
'cu3': QasmBuiltinGate('cu3', ['theta', 'phi', 'lambda'], ['c', 't']),
'swap': QasmBuiltinGate('swap', [], ['c', 't']),
'ccx': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
'toffoli': QasmBuiltinGate('ccx', [], ['c1', 'c2', 't']),
# TODO: These gates are not defined in qelib1, but defined in language specifications.
'U': QasmBuiltinGate('u3', ['theta', 'phi', 'lambda'], ['t']),
'CX': QasmBuiltinGate('cx', [], ['c', 't'])
})