SubstitutePi4Rotations
class qiskit.transpiler.passes.SubstitutePi4Rotations(*args, **kwargs)
베이스: TransformationPass
각도가 의 정수 배인 회전 게이트를 클리포드 게이트, TGate 및 TdgGate 게이트의 이산 집합으로 변환하십시오.
단일 큐비트 회전 게이트(RXGate, RYGate, RZGate, PhaseGate)와 2큐비트 회전 게이트(RXXGate, RYYGate, RZZGate, RZXGate)의 경우, 각도가 의 배수일 때, 이 분해에는 단일 TGate 또는 TdgGate 게이트와 몇 가지 클리포드 게이트가 필요합니다. 2-큐비트 제어 회전 게이트(CPhaseGate, CRXGate, CRYGate, CRZGate)의 경우, 각도가 의 배수일 때, 분해에는 에 대해 세 개의 TGate 또는 TdgGate 게이트가 필요하고, CPhaseGate 그렇지 않은 경우에는 두 개가 필요하며, 여기에 몇 개의 클리포드 게이트도 함께 사용된다. 의 배수(제어된 회전의 경우 각각 ) 또는 이에 상응하는 의 정수 배수(제어된 회전의 경우 각각 )도 클리포드 게이트만을 사용하여 표현할 수 있다는 점에 유의하십시오.
예를 들어,
from qiskit.circuit import QuantumCircuit
from qiskit.transpiler.passes import SubstitutePi4Rotations
from qiskit.quantum_info import Operator
# The following quantum circuit consists of 5 Clifford gates,
# four rotation gates whose angles are integer multiples of pi/4,
# and one controlled rotation gate whose angle is an integer multiple of pi/2
qc = QuantumCircuit(3)
qc.cx(0, 1)
qc.rz(pi/4, 0)
qc.cz(0, 1)
qc.rx(3*pi/4, 1)
qc.h(1)
qc.s(2)
qc.ry(2*pi/4, 2)
qc.cz(2, 0)
qc.rzz(pi/4, 0, 2)
qc.cry(3*pi/2, 2, 1)
# The transformed circuit consists of Clifford, T and Tdg gates
qct = SubstitutePi4Rotations()(qc)
clifford_t_names = get_clifford_gate_names() + ["t"] + ["tdg"]
assert(set(qct.count_ops().keys()).issubset(set(clifford_t_names)))
# The circuits before and after the transformation are equivalent
assert Operator(qc) == Operator(qct)매개변수
근사_정도 – 공차 계산에 사용됩니다. 이는 평균 게이트 충실도의 임계값을 제공합니다.
속성
is_analysis_pass
패스가 분석 패스인지 확인하십시오.
해당 패스가 속성 집합 분석기( AnalysisPass, )인 경우, 이는 해당 패스가 DAG를 분석하고 그 분석 결과를 속성 집합에 기록할 수 있음을 의미합니다. 이 유형의 패스에서는 DAG에 대한 수정이 허용되지 않습니다.
is_transformation_pass
패스가 변환 패스인지 확인하십시오.
해당 패스가 속성 집합을 수정할 수 없는 권한( TransformationPass, )인 경우, 이는 패스가 DAG를 조작할 수 있지만 속성 집합을 수정할 수 없음을 의미합니다(단, 읽기는 가능합니다).
메소드
execute
execute(passmanager_ir, state, callback=None)
입력 Qiskit IR에 대해 최적화 작업을 실행합니다.
매개변수
- passmanager_ir (DAGCircuit) – 최적화할 Qiskit IR.
- state (DAGCircuit) – 패스 관리자 자체에 의한 워크플로 실행과 관련된 상태.
- callback (Callable[[Task, DAGCircuit, PropertySet, float, int], None] | None) – 최적화 작업이 실행될 때마다 호출되는 콜백 함수입니다.
리턴
최적화된 Qiskit 인터프리터 및 워크플로 현황
리턴 유형
튜플 [ DAGCircuit, PassManagerState ]
name
run
update_status
update_status(state, run_state)
워크플로 상태 업데이트.
매개변수
- state (PassManagerState) – 패스 매니저 상태를 업데이트합니다.
- run_state (RunState) – 현재 작업의 완료 상태.
리턴
패스 관리자 상태를 업데이트했습니다.
리턴 유형