Skip to content
45 changes: 0 additions & 45 deletions libs/qec/python/bindings/py_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* This source code and the accompanying materials are made available under *
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/
#include "common/ExecutionContext.h"
#include "cuda-qx/core/kwargs_utils.h"
#include "cuda-qx/core/library_utils.h"
#include "sparse_matrix_casters.h"
Expand Down Expand Up @@ -1233,50 +1232,6 @@ void bindDecoder(nb::module_ &mod) {
[Internal] Load local simulation realtime decoder library.
)pbdoc");

qecmod.def(
Comment thread
bmhowe23 marked this conversation as resolved.
"compute_msm",
[](std::function<void()> kernel, bool verbose = false) {
cudaq::ExecutionContext ctx_msm_size("msm_size");
auto &platform = cudaq::get_platform();
platform.with_execution_context(ctx_msm_size, kernel);
if (!ctx_msm_size.msm_dimensions.has_value()) {
throw std::runtime_error("No MSM dimensions found");
}
if (ctx_msm_size.msm_dimensions.value().second == 0) {
throw std::runtime_error("No MSM dimensions found");
}
cudaq::ExecutionContext ctx_msm("msm");
ctx_msm.msm_dimensions = ctx_msm_size.msm_dimensions;
platform.with_execution_context(ctx_msm, kernel);

auto msm_as_strings = ctx_msm.result.sequential_data();
if (verbose) {
printf("MSM Dimensions: %ld measurements x %ld error mechanisms\n",
ctx_msm.msm_dimensions.value().first,
ctx_msm.msm_dimensions.value().second);
for (std::size_t i = 0; i < ctx_msm.msm_dimensions.value().first;
i++) {
for (std::size_t j = 0; j < ctx_msm.msm_dimensions.value().second;
j++) {
printf("%c", msm_as_strings[j][i] == '1' ? '1' : '.');
}
printf("\n");
}
}
return std::make_tuple(msm_as_strings, ctx_msm.msm_dimensions.value(),
ctx_msm.msm_probabilities.value(),
ctx_msm.msm_prob_err_id.value());
},
"");
qecmod.def(
"construct_mz_table",
[](const std::vector<std::string> &msm_as_strings) {
cudaqx::tensor<uint8_t> mzTable(msm_as_strings);
mzTable = mzTable.transpose();
return cudaq::python::copyCUDAQXTensorToPyArray(mzTable);
},
"");

qecmod.def(
"generate_timelike_sparse_detector_matrix",
[](std::uint32_t num_syndromes_per_round, std::uint32_t num_rounds,
Expand Down
2 changes: 0 additions & 2 deletions libs/qec/python/cudaq_qec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ def checked_decode_batch(self, *args, **kwargs):
simplify_pcm = qecrt.simplify_pcm
sort_pcm_columns = qecrt.sort_pcm_columns
pcm_extend_to_n_rounds = qecrt.pcm_extend_to_n_rounds
compute_msm = qecrt.compute_msm
construct_mz_table = qecrt.construct_mz_table
generate_timelike_sparse_detector_matrix = qecrt.generate_timelike_sparse_detector_matrix
pcm_to_sparse_vec = qecrt.pcm_to_sparse_vec

Expand Down
10 changes: 0 additions & 10 deletions libs/qec/unittests/realtime/app_examples/surface_code-2-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,6 @@ $EXE_PATH1 --distance $DISTANCE --num_shots $NUM_SHOTS --save_dem $CONFIG_FILE |

export CUDAQ_DUMP_JIT_IR=${CUDAQ_DUMP_JIT_IR:-0}

# This is a temporary workaround to allow the Quantinuum tests to run with the
# current compiler. Without this environment variable, one is likely to
# encounter errors like:
# invalid instruction found in adaptive QIR profile: %0 = alloca [8 x i1], align 1
# Disable once
# https://gitlab-master.nvidia.com/cuda-quantum/cuda-quantum/-/merge_requests/24
# is merged.
# export QIR_ALLOW_ALL_INSTRUCTIONS=1



# Use the config file using the second executable.
echo Running $EXE_PATH2 --distance $DISTANCE --num_shots $NUM_SHOTS --load_dem $CONFIG_FILE
Expand Down
Loading
Loading