Skip to content

Commit

Permalink
planted noisy kXOR algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
anurudhp committed Dec 21, 2024
1 parent e450865 commit 6dfc126
Show file tree
Hide file tree
Showing 31 changed files with 12,912 additions and 11 deletions.
46 changes: 46 additions & 0 deletions dev_tools/qualtran_dev_tools/notebook_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
import qualtran.bloqs.gf_arithmetic.gf2_multiplication
import qualtran.bloqs.gf_arithmetic.gf2_square
import qualtran.bloqs.hamiltonian_simulation.hamiltonian_simulation_by_gqsp
import qualtran.bloqs.max_k_xor_sat
import qualtran.bloqs.max_k_xor_sat.guided_hamiltonian
import qualtran.bloqs.mcmt.and_bloq
import qualtran.bloqs.mcmt.controlled_via_and
import qualtran.bloqs.mcmt.ctrl_spec_and
Expand Down Expand Up @@ -904,6 +906,49 @@
),
]

# --------------------------------------------------------------------------
# ----- Quartic Speedups paper ------------------------------------------
# --------------------------------------------------------------------------
ALGO_QUARTIC_SPEEDUPS = [
# ----- Preliminaries ------------------------------------------
NotebookSpecV2(
title='Guided (sparse) Hamiltonian Problem',
module=qualtran.bloqs.max_k_xor_sat.guided_hamiltonian.guided_hamiltonian,
bloq_specs=[
qualtran.bloqs.max_k_xor_sat.guided_hamiltonian.guided_hamiltonian._GUIDED_HAMILTONIAN_DOC,
qualtran.bloqs.max_k_xor_sat.guided_hamiltonian.guided_hamiltonian._GUIDED_HAMILTONIAN_PHASE_ESTIMATION_DOC,
],
),
# ----- Algorithm ------------------------------------------
NotebookSpecV2(
title='kXOR: Instance load Oracles',
module=qualtran.bloqs.max_k_xor_sat.load_kxor_instance,
bloq_specs=[qualtran.bloqs.max_k_xor_sat.load_kxor_instance._LOAD_INSTANCE_DOC],
),
NotebookSpecV2(
title='Noisy kXOR: Guiding State',
module=qualtran.bloqs.max_k_xor_sat.guiding_state,
bloq_specs=[
qualtran.bloqs.max_k_xor_sat.guiding_state._SIMPLE_GUIDING_STATE_DOC,
qualtran.bloqs.max_k_xor_sat.guiding_state._GUIDING_STATE_DOC,
],
),
NotebookSpecV2(
title='Noisy kXOR: Block-encoding the Kikuchi Matrix',
module=qualtran.bloqs.max_k_xor_sat.kikuchi_block_encoding,
bloq_specs=[
qualtran.bloqs.max_k_xor_sat.kikuchi_adjacency_matrix._KIKUCHI_MATRIX_ENTRY_DOC,
qualtran.bloqs.max_k_xor_sat.kikuchi_adjacency_list._KIKUCHI_NONZERO_INDEX_DOC,
qualtran.bloqs.max_k_xor_sat.kikuchi_block_encoding._KIKUCHI_HAMILTONIAN_DOC,
],
),
NotebookSpecV2(
title='Algorithm: Planted Noise kXOR',
module=qualtran.bloqs.max_k_xor_sat.planted_noisy_kxor,
bloq_specs=[qualtran.bloqs.max_k_xor_sat.planted_noisy_kxor._PLANTED_NOISY_KXOR_DOC],
),
]

NB_BY_SECTION = [
('Basic Gates', BASIC_GATES),
('Chemistry', CHEMISTRY),
Expand All @@ -912,5 +957,6 @@
('GF Arithmetic', GF_ARITHMETIC),
('Rotations', ROT_QFT_PE),
('Block Encoding', BLOCK_ENCODING),
('Paper: Quartic Quantum Speedups for Planted Inference', ALGO_QUARTIC_SPEEDUPS),
('Other', OTHER),
]
10 changes: 10 additions & 0 deletions docs/bloqs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ Bloqs Library
block_encoding/chebyshev_polynomial.ipynb
block_encoding/lcu_block_encoding.ipynb

.. toctree::
:maxdepth: 2
:caption: Paper: Quartic Quantum Speedups for Planted Inference:

max_k_xor_sat/guided_hamiltonian/guided_hamiltonian.ipynb
max_k_xor_sat/load_kxor_instance.ipynb
max_k_xor_sat/guiding_state.ipynb
max_k_xor_sat/kikuchi_block_encoding.ipynb
max_k_xor_sat/planted_noisy_kxor.ipynb

.. toctree::
:maxdepth: 2
:caption: Other:
Expand Down
4 changes: 4 additions & 0 deletions qualtran/bloqs/max_k_xor_sat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from .guiding_state import GuidingState, SimpleGuidingState
from .kikuchi_adjacency_list import KikuchiNonZeroIndex
from .kikuchi_adjacency_matrix import KikuchiMatrixEntry
from .kikuchi_block_encoding import KikuchiHamiltonian, KikuchiMatrixEntry, KikuchiNonZeroIndex
from .kxor_instance import Constraint, KXorInstance
from .planted_noisy_kxor import AliceTheorem, PlantedNoisyKXOR
15 changes: 15 additions & 0 deletions qualtran/bloqs/max_k_xor_sat/guided_hamiltonian/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from .guided_hamiltonian import GuidedHamiltonian, GuidedHamiltonianPhaseEstimation
from .walk_operator import QubitizedWalkOperator
Loading

0 comments on commit 6dfc126

Please sign in to comment.