Givens Rotations#
The Givens rotation Bloqs help count costs for similarity transforming fermionic ladder operators to produce linear combinations of fermionic ladder operators.
Following notation from Reference [1] we note that a single ladder operator can be similarity transformed by a basis rotation to produce a linear combination of ladder operators
References:
Vera von Burg, Guang Hao Low, Thomas H ̈aner, Damian S. Steiger, Markus Reiher, Martin Roetteler, and Matthias Troyer, “Quantum computing enhanced computational catalysis,” Phys. Rev. Res. 3, 033055 (2021).
from qualtran import Bloq, CompositeBloq, BloqBuilder, Signature, Register
from qualtran import QBit, QInt, QUInt, QAny
from qualtran.drawing import show_bloq, show_call_graph, show_counts_sigma
from typing import *
import numpy as np
import sympy
import cirq
RealGivensRotationByPhaseGradient
#
Givens rotation corresponding to a 2-fermion mode transformation generated by
corresponding to the circuit
i: ───X───X───S^-1───X───Rz(theta)───X───X───@───────X───S^-1───
│ │ │ │ │
j: ───S───@───H──────@───Rz(theta)───@───────X───H───@──────────
The rotation is performed by addition into a phase state and the fractional binary for \(\theta\) is stored in an additional register.
The Toffoli cost for this block comes from the cost of two rotations by addition into the phase gradient state which which is \(2(b_{\mathrm{grad}}-2)\) where \(b_{\mathrm{grad}}\) is the size of the phasegradient register.
Parameters#
phasegrad_bitsize int
: size of phase gradient which is also the size of the register representing the binary fraction of the rotation angle
Registers#
target_i
: 1st-qubit QBit type registertarget_j
: 2nd-qubit Qbit type registerrom_data
: QFxp data representing fractional binary for real part of rotationphase_gradient
: QFxp data type representing the phase gradient register
References#
Compilation of Fault-Tolerant Quantum Heuristics for Combinatorial Optimization. Section II-C: Oracles for phasing by cost function. Appendix A: Addition for controlled rotations.
from qualtran.bloqs.chemistry.quad_fermion.givens_bloq import RealGivensRotationByPhaseGradient
Example Instances#
real_givens = RealGivensRotationByPhaseGradient(phasegrad_bitsize=4)
Graphical Signature#
from qualtran.drawing import show_bloqs
show_bloqs([real_givens],
['`real_givens`'])
Call Graph#
from qualtran.resource_counting.generalizers import ignore_split_join
real_givens_g, real_givens_sigma = real_givens.call_graph(max_depth=1, generalizer=ignore_split_join)
show_call_graph(real_givens_g)
show_counts_sigma(real_givens_sigma)
Counts totals:
CNOT
: 5H
: 2RzViaPhaseGradient
: 2S
: 2S†
: 1XGate
: 2
ComplexGivensRotationByPhaseGradient
#
Complex Givens rotation corresponding to a 2-fermion mode transformation generated by
corresponding to the circuit
i: ───X───X───S^-1───X───Rz(theta)───X───X───@───────X──S^-1─────
│ │ │ │ │
j: ───S───@───H──────@───Rz(theta)───@───────X───H───@──Rz(phi)──
The rotation is performed by addition into a phase state and the fractional binary for \(\theta\) is stored in an additional register.
Parameters#
phasegrad_bitsize int
: size of phase gradient which is also the size of the register representing the binary fraction of the rotation angles
Registers#
target_i
: 1st-qubit QBit type registertarget_j
: 2nd-qubit Qbit type registerreal_rom_data
: QFxp data representing fractional binary for real part of rotationcplx_rom_data
: QFxp data representing fractional binary for imag part of rotationphase_gradient
: QFxp data type representing the phase gradient register
from qualtran.bloqs.chemistry.quad_fermion.givens_bloq import ComplexGivensRotationByPhaseGradient
Example Instances#
cplx_givens = ComplexGivensRotationByPhaseGradient(phasegrad_bitsize=4)
Graphical Signature#
from qualtran.drawing import show_bloqs
show_bloqs([cplx_givens],
['`cplx_givens`'])
Call Graph#
from qualtran.resource_counting.generalizers import ignore_split_join
cplx_givens_g, cplx_givens_sigma = cplx_givens.call_graph(max_depth=1, generalizer=ignore_split_join)
show_call_graph(cplx_givens_g)
show_counts_sigma(cplx_givens_sigma)
Counts totals:
RealGivensRotationByPhaseGradient
: 1RzViaPhaseGradient
: 1