diff --git a/README.md b/README.md index bd3c24c..a32b36c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ - [ ] Build out pauli decomposer - [X] Remove the weights argument and rename to data - [X] Add namespace -- [ ] Add function equivalent of `get_state_iteration_unequal_weights` to SummedPauliOp +- [ ] Add apply method to SummedPauliOp that takes precomputed weighted data - [ ] Writeup for docs - [ ] Add pybind11 interface and python examples - [ ] Change functions names over to default to parallel impl and use `_serial` for the serial implementation diff --git a/include/__summed_pauli_op.hpp b/include/__summed_pauli_op.hpp index 4a18bb0..56fb0d6 100644 --- a/include/__summed_pauli_op.hpp +++ b/include/__summed_pauli_op.hpp @@ -214,7 +214,6 @@ template struct SummedPauliOp { } // TODO IMPLEMENT - // equivalent to get_state_iteration_unequal_weights in the python code template void apply_parallel_weighted_data( Tensor<2> new_states, Tensor<2> states, diff --git a/qcog_bench.py b/qcog_bench.py deleted file mode 100644 index f2acf62..0000000 --- a/qcog_bench.py +++ /dev/null @@ -1,55 +0,0 @@ -from typing import Any -import numpy as np -import time - -from qcog.src.classical.pauli_symbolic import ClassicalPauliSymbolic as PauliHSM -from qcog.src.classical.common import OptimizationMethod, StateMethod -from qcog.src.compiled.pauli.pauli_utils import get_state_iteration_unequal_weights - -config: dict[str, Any] = { - "hsm_type": "pauli", - "data_params": {"train_size": 10000, "test_size": 1000, "dataset": "mnist"}, - "random_seed": 42, - "initialization_params": { - "qbits": 14, - "pauli_weight": 2, - }, - "train_params": { - "weight_optimization_kwargs": { - "optimization_method": OptimizationMethod.ANALYTIC.value, - }, - "batch_size": 10000, - "num_passes": 4, - "state_kwargs": { - "state_method": StateMethod.LOBPCG_FAST.value, - "iterations": 10, - "tolerance": 0.1, - }, - }, - "forecast_params": { - "state_method": StateMethod.LOBPCG_FAST.value, - "iterations": 10, - }, -} - - -n_operators = 10000 -n_data = 1000 -operators = [str(i) for i in range(n_operators)] -data = np.zeros((n_data, n_operators)) -states = np.zeros( - (n_data, 2 ** config["initialization_params"]["qbits"]), dtype=np.complex128 -) - - -hsm = PauliHSM(operators=operators, **config["initialization_params"]) - -ham_terms = hsm._generate_ham_components(data, operators) -A2, xA_weights, data_term = ham_terms - -t0 = time.perf_counter() -new_states = get_state_iteration_unequal_weights( - states, hsm._pauli_str_array, xA_weights -) - -print(f"Time for x_kt * A_k |psi_t>: {time.perf_counter() - t0:.2f} s")