@@ -322,6 +322,12 @@ PYBIND11_MODULE(pyqcec, m, py::mod_gil_not_used()) {
322
322
" Set the :attr:`trace threshold "
323
323
" <.Configuration.Functionality.trace_threshold>` used for comparing "
324
324
" two unitaries or functionality matrices." )
325
+ .def (" set_approximate_checking_threshold" ,
326
+ &EquivalenceCheckingManager::setApproximateCheckingThreshold,
327
+ " threshold" _a = 1e-8 ,
328
+ " Set the :attr:`approximate checking threshold "
329
+ " <.Configuration.Functionality.approximate_checking_threshold>` "
330
+ " used for approximate equivalence checking." )
325
331
.def (
326
332
" set_check_partial_equivalence" ,
327
333
&EquivalenceCheckingManager::setCheckPartialEquivalence,
@@ -331,6 +337,16 @@ PYBIND11_MODULE(pyqcec, m, py::mod_gil_not_used()) {
331
337
" they have the same probability for each measurement outcome. "
332
338
" If set to false, the checker will output 'not equivalent' for "
333
339
" circuits that are partially equivalent but not totally equivalent. " )
340
+ .def (" set_check_approximate_equivalence" ,
341
+ &EquivalenceCheckingManager::setCheckApproximateEquivalence,
342
+ " enable" _a = false ,
343
+ " Set whether to check for approximate equivalence. Two circuits are "
344
+ " approximately equivalent if the Hilbert-Schmidt inner product "
345
+ " (process distance) of the two circuits is less than the "
346
+ " approximate_checking_threshold. "
347
+ " If set to false, the checker will output 'not equivalent' for "
348
+ " circuits that are approximately equivalent but not totally "
349
+ " equivalent. " )
334
350
// Simulation
335
351
.def (" set_fidelity_threshold" ,
336
352
&EquivalenceCheckingManager::setFidelityThreshold,
@@ -668,6 +684,15 @@ PYBIND11_MODULE(pyqcec, m, py::mod_gil_not_used()) {
668
684
" Whenever any decision diagram node differs from this structure by "
669
685
" more than the configured threshold, the circuits are concluded to "
670
686
" be non-equivalent. Defaults to :code:`1e-8`." )
687
+ .def_readwrite (
688
+ " approximate_checking_threshold" ,
689
+ &Configuration::Functionality::approximateCheckingThreshold,
690
+ " To determine approximate equivalence, the Hilbert-Schmidt inner "
691
+ " product (or process distance) between two circuit representations "
692
+ " is calculated and compared against the "
693
+ " approximate_checking_threshold. If the process distance falls below "
694
+ " this threshold, the circuits are considered approximately "
695
+ " equivalent. Defaults to :code:`1e-8`." )
671
696
.def_readwrite (
672
697
" check_partial_equivalence" ,
673
698
&Configuration::Functionality::checkPartialEquivalence,
@@ -679,6 +704,21 @@ PYBIND11_MODULE(pyqcec, m, py::mod_gil_not_used()) {
679
704
" output 'not equivalent' for circuits that are partially equivalent "
680
705
" but not totally equivalent. In particular, garbage qubits will be "
681
706
" treated as if they were measured qubits. Defaults to "
707
+ " :code:`False`." )
708
+ .def_readwrite (
709
+ " check_approximate_equivalence" ,
710
+ &Configuration::Functionality::checkApproximateEquivalence,
711
+ " To determine approximate equivalence, the Hilbert-Schmidt inner "
712
+ " product (or process distance) between two circuit representations "
713
+ " is calculated and compared against the "
714
+ " approximate_checking_threshold. If the process distance falls below "
715
+ " this threshold, the circuits are considered approximately "
716
+ " equivalent. If set to :code:`True`, a check for approximate "
717
+ " equivalence "
718
+ " will be performed. If set to :code:`False`, the checker will "
719
+ " output 'not equivalent' for circuits that are approximately "
720
+ " equivalent "
721
+ " but not totally equivalent. Defaults to "
682
722
" :code:`False`." );
683
723
684
724
// simulation options
@@ -752,5 +792,5 @@ PYBIND11_MODULE(pyqcec, m, py::mod_gil_not_used()) {
752
792
" to simpler equivalence checking instances as the random "
753
793
" instantiation. This option "
754
794
" changes how many of those additional checks are performed." );
755
- }
795
+ };
756
796
} // namespace ec
0 commit comments