Optimal resource states for Phase Estimation by A. Luis and J. Peřina#
Resource states proposed by A. Luis and J. Peřina (1996) for optimal phase measurements
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
LPRSInterimPrep
#
Helper Bloq to prepare an intermediate resource state which can be used in AA
Specifically, this prepares the state
This is the state obtained after applying the Hadamard on the flag qubit as described in Eq 19 of https://arxiv.org/pdf/1805.03662.pdf, which can then be used in a single round of Amplitude Amplification to boost the amplitude of desired resource state to 1.
from qualtran.bloqs.phase_estimation.lp_resource_state import LPRSInterimPrep
Example Instances#
lprs_interim_prep = LPRSInterimPrep(5)
Graphical Signature#
from qualtran.drawing import show_bloqs
show_bloqs([lprs_interim_prep],
['`lprs_interim_prep`'])
Call Graph#
from qualtran.resource_counting.generalizers import ignore_split_join
lprs_interim_prep_g, lprs_interim_prep_sigma = lprs_interim_prep.call_graph(max_depth=1, generalizer=ignore_split_join)
show_call_graph(lprs_interim_prep_g)
show_counts_sigma(lprs_interim_prep_sigma)
Counts totals:
C[Rz(-0.19039955476301776)]
: 1C[Rz(-0.3807991095260355)]
: 1C[Rz(-0.761598219052071)]
: 1C[Rz(-1.523196438104142)]
: 1C[Rz(-3.046392876208284)]
: 1H
: 2H⨂5
: 1Rz(-0.19039955476301776)
: 1
LPResourceState
#
Prepares optimal resource state \(\chi_{m}\) proposed by A. Luis and J. Peřina (1996)
Uses a single round of amplitude amplification, as described in Ref 2, to prepare the resource state from Ref 1 described as
Parameters#
bitsize
: The size of the phase register to prepare the resource state on.
References#
Optimum phase-shift estimation and the quantum description of the phase difference.
Encoding Electronic Spectra in Quantum Circuits with Linear T Complexity. Section II-B
from qualtran.bloqs.phase_estimation.lp_resource_state import LPResourceState
Example Instances#
lp_resource_state_small = LPResourceState(5)
import sympy
lp_resource_state_symbolic = LPResourceState(sympy.Symbol('n'))
Graphical Signature#
from qualtran.drawing import show_bloqs
show_bloqs([lp_resource_state_small, lp_resource_state_symbolic],
['`lp_resource_state_small`', '`lp_resource_state_symbolic`'])
Call Graph#
from qualtran.resource_counting.generalizers import ignore_split_join
lp_resource_state_small_g, lp_resource_state_small_sigma = lp_resource_state_small.call_graph(max_depth=1, generalizer=ignore_split_join)
show_call_graph(lp_resource_state_small_g)
show_counts_sigma(lp_resource_state_small_sigma)
Counts totals:
CZ
: 1LPRSInterimPrep
: 2LPRSInterimPrep†
: 1ReflectionUsingPrepare
: 1Ry(-1.5404886568287097)
: 1Ry(1.5404886568287097)
: 2XGate
: 2