qp.transforms.decompositions.make_phase_gradient_distillation_decomp¶
- make_phase_gradient_distillation_decomp(aux_wires, work_wires, mode='repeat-until-success')[source]¶
Create a decomposition rule for
PhaseGradientStatePrepbased on Jones distillation.The rule implements the Fourier-state distillation protocol from Jones (2013) and uses only Clifford gates,
SemiAdder, (Pauli) mid-circuit measurements, and classical control. The prepared state is approximate: the number of distillation rounds grows as \(\mathcal{O}(\log n)\) for an \(n\)-qubit register and targets an infidelity of at most \(\sin^2(\pi/2^n)\).The output, auxiliary, and work registers require \(n\), \(n\), and \(n-1\) wires, respectively. All wires must be distinct and start in \(|0\rangle\). The decomposition uses the negative-phase convention of
PhaseGradientStatePrep.- Parameters:
aux_wires (WiresLike) – auxiliary register with the same size as the output register, i.e. the target register of the
PhaseGradientStatePrepoperator to be decomposed.work_wires (WiresLike) – at least \(n-1\) clean wires used by
SemiAddermode (str) –
"repeat-until-success"(default) or"postselect", see below
- Returns:
the fixed decomposition rule
- Return type:
Example
Register the rule and select it by name in
qp.decompose()viafixed_decomps:import pennylane as qp registers = qp.registers({"grad": 3, "aux": 3, "work": 2}) rule = qp.transforms.decompositions.make_phase_gradient_distillation_decomp( registers["aux"], registers["work"] ) gate_set = { "Hadamard", "S", "Adjoint(S)", "T", "Adjoint(T)", "CNOT", "X", "Z", "measure", "PauliMeasure", } qp.add_decomps(qp.PhaseGradientStatePrep, rule) @qp.qjit(capture=True) @qp.decompose(gate_set=gate_set, fixed_decomps={qp.PhaseGradientStatePrep: rule.name}) @qp.qnode(qp.device("lightning.qubit", wires=8)) def circuit(): qp.PhaseGradientStatePrep(registers["grad"]) return qp.state()
Only Clifford+T gates and (Pauli) mid-circuit measurements remain:
>>> sorted(qp.analyze(circuit)().resources.quantum_operations) ['Adjoint(S)', 'Adjoint(T)', 'CNOT', 'Hadamard', 'MidCircuitMeasure', 'PPM-w1', 'PauliX', 'PauliZ', 'T']