compiled-knowledge 4.0.0a21__cp312-cp312-macosx_10_13_x86_64.whl → 4.0.0a23__cp312-cp312-macosx_10_13_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of compiled-knowledge might be problematic. Click here for more details.

Files changed (32) hide show
  1. ck/circuit/_circuit_cy.c +50 -60
  2. ck/circuit/_circuit_cy.cpython-312-darwin.so +0 -0
  3. ck/circuit/_circuit_cy.pyx +1 -1
  4. ck/circuit/_circuit_py.py +1 -1
  5. ck/circuit_compiler/cython_vm_compiler/_compiler.c +179 -170
  6. ck/circuit_compiler/cython_vm_compiler/_compiler.cpython-312-darwin.so +0 -0
  7. ck/circuit_compiler/cython_vm_compiler/_compiler.pyx +3 -3
  8. ck/circuit_compiler/cython_vm_compiler/cython_vm_compiler.py +14 -7
  9. ck/circuit_compiler/interpret_compiler.py +36 -4
  10. ck/circuit_compiler/llvm_compiler.py +4 -4
  11. ck/circuit_compiler/llvm_vm_compiler.py +9 -3
  12. ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.c +1 -1
  13. ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.cpython-312-darwin.so +0 -0
  14. ck/circuit_compiler/support/llvm_ir_function.py +18 -1
  15. ck/pgm.py +1 -1
  16. ck/pgm_circuit/mpe_program.py +2 -2
  17. ck/pgm_circuit/support/compile_circuit.py +4 -7
  18. ck/pgm_compiler/named_pgm_compilers.py +0 -3
  19. ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c +1 -1
  20. ck/pgm_compiler/support/circuit_table/_circuit_table_cy.cpython-312-darwin.so +0 -0
  21. ck/pgm_compiler/support/clusters.py +8 -4
  22. ck/program/raw_program.py +41 -9
  23. ck/utils/np_extras.py +5 -5
  24. ck_demos/ace/simple_ace_demo.py +18 -0
  25. ck_demos/getting_started/__init__.py +0 -0
  26. ck_demos/getting_started/simple_demo.py +18 -0
  27. ck_demos/programs/demo_raw_program_dump.py +17 -0
  28. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/METADATA +1 -1
  29. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/RECORD +32 -28
  30. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/WHEEL +0 -0
  31. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/licenses/LICENSE.txt +0 -0
  32. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/top_level.txt +0 -0
ck/circuit/_circuit_cy.c CHANGED
@@ -15,7 +15,7 @@
15
15
  "-O3"
16
16
  ],
17
17
  "include_dirs": [
18
- "/private/var/folders/vk/nx37ffx50hv5djclhltc26vw0000gn/T/build-env-_or56hnr/lib/python3.12/site-packages/numpy/_core/include"
18
+ "/private/var/folders/vk/nx37ffx50hv5djclhltc26vw0000gn/T/build-env-6dutqwq8/lib/python3.12/site-packages/numpy/_core/include"
19
19
  ],
20
20
  "name": "ck.circuit._circuit_cy",
21
21
  "sources": [
@@ -1769,7 +1769,7 @@ struct __pyx_obj_2ck_7circuit_11_circuit_cy___pyx_scope_struct_6_dump {
1769
1769
 
1770
1770
 
1771
1771
  /* "ck/circuit/_circuit_cy.pyx":364
1772
- * for op in reversed(self.ops):
1772
+ * for op in self.ops:
1773
1773
  * op_name = node_name[id(op)]
1774
1774
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
1775
1775
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -3047,7 +3047,6 @@ static PyObject *__pyx_builtin_range;
3047
3047
  static PyObject *__pyx_builtin_print;
3048
3048
  static PyObject *__pyx_builtin_id;
3049
3049
  static PyObject *__pyx_builtin_enumerate;
3050
- static PyObject *__pyx_builtin_reversed;
3051
3050
  static PyObject *__pyx_builtin_RuntimeError;
3052
3051
  static PyObject *__pyx_builtin_super;
3053
3052
  /* #### Code section: string_decls ### */
@@ -3186,7 +3185,6 @@ static const char __pyx_k_op_nodes[] = "op nodes: ";
3186
3185
  static const char __pyx_k_overload[] = "overload";
3187
3186
  static const char __pyx_k_pyx_type[] = "__pyx_type";
3188
3187
  static const char __pyx_k_qualname[] = "__qualname__";
3189
- static const char __pyx_k_reversed[] = "reversed";
3190
3188
  static const char __pyx_k_set_name[] = "__set_name__";
3191
3189
  static const char __pyx_k_setstate[] = "__setstate__";
3192
3190
  static const char __pyx_k_var_name[] = "var_name";
@@ -3325,7 +3323,7 @@ static const char __pyx_k_T_a_G1F_a_vWA_q_t87_s_fG1_q_d_7[] = "\200\001\360\010\
3325
3323
  static const char __pyx_k_T_d_8_G4_SWWX_G1F_a_vWA_q_t_we3[] = "\200\001\360\010\000\005\016\210T\220\035\230d\320\"8\270\004\270G\3004\300|\320SW\320WX\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\230<\240w\250e\2603\260d\320:O\310w\320V[\320[^\320^b\320bh\320ho\320ot\320tw\320w{\360\000\000|\001F\002\360\000\000F\002M\002\360\000\000M\002N\002\330\004\007\200q\330\010\017\320\017'\240t\2501\250G\260;\270g\300Q\340\010\017\320\017'\240t\2501\250G\260;\270a";
3326
3324
  static const char __pyx_k_T_fD_dRYY_G1F_a_vWA_q_t_2_c_QXX[] = "\200\001\360\010\000\005\016\210T\320\021)\250\024\250]\270$\270f\300D\310\006\310d\320RY\320Y]\320]^\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\320\0332\260'\270\025\270c\300\024\300\\\320QX\320X]\320]`\320`d\320di\320ip\320pu\320ux\320x|\360\000\000}\001B\002\360\000\000B\002I\002\360\000\000I\002N\002\360\000\000N\002Q\002\360\000\000Q\002U\002\360\000\000U\002[\002\360\000\000[\002b\002\360\000\000b\002g\002\360\000\000g\002j\002\360\000\000j\002n\002\360\000\000n\002t\002\360\000\000t\002{\002\360\000\000{\002|\002\330\004\007\200q\330\010\017\320\017(\250\004\250A\250W\260K\270w\300a\340\010\017\320\017(\250\004\250A\250W\260K\270q";
3327
3325
  static const char __pyx_k_T_j_F_it1_G1F_a_vWA_q_t87_s_iwa[] = "\200\001\360\010\000\005\016\210T\220\031\230$\230j\250\004\250F\260$\260i\270t\3001\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\2308\2407\250%\250s\260$\260i\270w\300a\330\004\007\200q\330\010\017\320\017(\250\004\250A\250W\260K\270w\300a\340\010\017\320\017(\250\004\250A\250W\260K\270q";
3328
- static const char __pyx_k_A_Q_1_7_A_A_Qb_D_Qb_34q_Qb_0_A_Q[] = "\200A\360\006\000\025\033\230!\330\024\032\230!\330\027-\250Q\330\034#\2401\330\t\n\360\030\000\t\034\2307\240\"\240A\340\010$\240A\340\010\r\210Q\210b\220\004\320\024,\250D\260\001\330\010\r\210Q\210b\220\004\320\0243\2604\260q\330\010\r\210Q\210b\220\004\320\0240\260\004\260A\330\010\r\210Q\210b\220\004\320\0242\260$\260a\330\010\r\210Q\210b\220\004\320\024,\250D\260\001\340\010\r\210Q\210b\220\004\320\024'\240t\2501\330\010\014\210G\2204\220q\330\014\025\220Q\220b\230\001\230\030\240\022\2408\2503\250a\330\014\034\230F\240*\250C\250u\260C\260s\270%\270s\300#\300Q\320FV\320V_\320_`\320`c\320cd\330\014\017\210y\230\003\2301\330\020\023\2203\220i\230q\330\024\031\230\021\230\"\230D\320 1\260\023\260I\270\\\310\023\310F\320RS\340\024\031\230\021\230\"\230D\320 1\260\023\260I\270Q\330\021\024\220I\230Q\330\020\025\220Q\220b\230\004\320\034-\250S\260\t\270\023\270F\300!\340\010\013\2101\330\014\021\220\021\220\"\220D\320\030-\250T\260\021\330\014\020\220\t\230\024\230[\250\007\250q\330\020\025\220Q\220b\230\004\230M\250\025\250a\360\006\000\t\r\210I\220T\230\033\240G\2501\330\014\025\220Q\220b\230\001\230\032\2404\240q\250\005\250Q\360\006\000\t\r\210C\210v\220Y\230a\230t\2401\330\014\025\220Q\220b\230\001\230\027\240\002\240$\240b\250\007\250u\260A\340\010\r\210Q\330\014\016\210d\320\022$\240D\250\001\330\016\031\230\024\320\0355\260T\270\021\340\010\014\210F\220(\230!\2304\230q\330\014\026\220i\230q\240\002\240!\2401\330\014\027\220s\230%\230z\250\021\330\014\021\220\021\220\"\220D\230\r\240[\260\001";
3326
+ static const char __pyx_k_A_Q_1_7_A_A_Qb_D_Qb_34q_Qb_0_A_Q[] = "\200A\360\006\000\025\033\230!\330\024\032\230!\330\027-\250Q\330\034#\2401\330\t\n\360\030\000\t\034\2307\240\"\240A\340\010$\240A\340\010\r\210Q\210b\220\004\320\024,\250D\260\001\330\010\r\210Q\210b\220\004\320\0243\2604\260q\330\010\r\210Q\210b\220\004\320\0240\260\004\260A\330\010\r\210Q\210b\220\004\320\0242\260$\260a\330\010\r\210Q\210b\220\004\320\024,\250D\260\001\340\010\r\210Q\210b\220\004\320\024'\240t\2501\330\010\014\210G\2204\220q\330\014\025\220Q\220b\230\001\230\030\240\022\2408\2503\250a\330\014\034\230F\240*\250C\250u\260C\260s\270%\270s\300#\300Q\320FV\320V_\320_`\320`c\320cd\330\014\017\210y\230\003\2301\330\020\023\2203\220i\230q\330\024\031\230\021\230\"\230D\320 1\260\023\260I\270\\\310\023\310F\320RS\340\024\031\230\021\230\"\230D\320 1\260\023\260I\270Q\330\021\024\220I\230Q\330\020\025\220Q\220b\230\004\320\034-\250S\260\t\270\023\270F\300!\340\010\013\2101\330\014\021\220\021\220\"\220D\320\030-\250T\260\021\330\014\020\220\t\230\024\230[\250\007\250q\330\020\025\220Q\220b\230\004\230M\250\025\250a\360\006\000\t\r\210I\220T\230\033\240G\2501\330\014\025\220Q\220b\230\001\230\032\2404\240q\250\005\250Q\360\006\000\t\r\210C\210v\220Y\230a\230t\2401\330\014\025\220Q\220b\230\001\230\027\240\002\240$\240b\250\007\250u\260A\340\010\r\210Q\330\014\016\210d\320\022$\240D\250\001\330\016\031\230\024\320\0355\260T\270\021\340\010\014\210F\220$\220a\330\014\026\220i\230q\240\002\240!\2401\330\014\027\220s\230%\230z\250\021\330\014\021\220\021\220\"\220D\230\r\240[\260\001";
3329
3327
  static const char __pyx_k_Circuit_remove_derivatives_cache[] = "Circuit.remove_derivatives_cache";
3330
3328
  static const char __pyx_k_Circuit_remove_unreachable_op_no[] = "Circuit.remove_unreachable_op_nodes";
3331
3329
  static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x769839a, 0xe0847da, 0xcebc8c6) = (_Circuit__derivatives, _const_map, one, ops, vars, zero))";
@@ -3540,7 +3538,7 @@ typedef struct {
3540
3538
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3541
3539
  PyObject *__pyx_tuple[8];
3542
3540
  PyObject *__pyx_codeobj_tab[49];
3543
- PyObject *__pyx_string_tab[243];
3541
+ PyObject *__pyx_string_tab[242];
3544
3542
  PyObject *__pyx_int_0;
3545
3543
  PyObject *__pyx_int_1;
3546
3544
  PyObject *__pyx_int_16976299;
@@ -3871,42 +3869,41 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati
3871
3869
  #define __pyx_n_u_remove_unreachable_op_nodes __pyx_string_tab[204]
3872
3870
  #define __pyx_n_u_result __pyx_string_tab[205]
3873
3871
  #define __pyx_n_u_return __pyx_string_tab[206]
3874
- #define __pyx_n_u_reversed __pyx_string_tab[207]
3875
- #define __pyx_n_u_self __pyx_string_tab[208]
3876
- #define __pyx_n_u_self_multiply __pyx_string_tab[209]
3877
- #define __pyx_n_u_send __pyx_string_tab[210]
3878
- #define __pyx_n_u_set_name __pyx_string_tab[211]
3879
- #define __pyx_n_u_setstate __pyx_string_tab[212]
3880
- #define __pyx_n_u_setstate_cython __pyx_string_tab[213]
3881
- #define __pyx_n_u_single_result __pyx_string_tab[214]
3882
- #define __pyx_kp_u_src_ck_circuit__circuit_cy_pyx __pyx_string_tab[215]
3883
- #define __pyx_n_u_state __pyx_string_tab[216]
3884
- #define __pyx_n_u_str __pyx_string_tab[217]
3885
- #define __pyx_kp_u_stringsource __pyx_string_tab[218]
3886
- #define __pyx_n_u_sum __pyx_string_tab[219]
3887
- #define __pyx_n_u_super __pyx_string_tab[220]
3888
- #define __pyx_n_u_symbol __pyx_string_tab[221]
3889
- #define __pyx_n_u_test __pyx_string_tab[222]
3890
- #define __pyx_n_u_throw __pyx_string_tab[223]
3891
- #define __pyx_n_u_to_add __pyx_string_tab[224]
3892
- #define __pyx_n_u_to_mul __pyx_string_tab[225]
3893
- #define __pyx_n_u_typing __pyx_string_tab[226]
3894
- #define __pyx_n_u_update __pyx_string_tab[227]
3895
- #define __pyx_n_u_use_setstate __pyx_string_tab[228]
3896
- #define __pyx_n_u_value __pyx_string_tab[229]
3897
- #define __pyx_n_u_values __pyx_string_tab[230]
3898
- #define __pyx_kp_u_var __pyx_string_tab[231]
3899
- #define __pyx_n_u_var_2 __pyx_string_tab[232]
3900
- #define __pyx_n_u_var_name __pyx_string_tab[233]
3901
- #define __pyx_n_u_var_names __pyx_string_tab[234]
3902
- #define __pyx_kp_u_var_nodes __pyx_string_tab[235]
3903
- #define __pyx_n_u_x __pyx_string_tab[236]
3904
- #define __pyx_n_u_xs __pyx_string_tab[237]
3905
- #define __pyx_n_u_xs_list __pyx_string_tab[238]
3906
- #define __pyx_n_u_y __pyx_string_tab[239]
3907
- #define __pyx_n_u_ys __pyx_string_tab[240]
3908
- #define __pyx_n_u_ys_list __pyx_string_tab[241]
3909
- #define __pyx_n_u_zero __pyx_string_tab[242]
3872
+ #define __pyx_n_u_self __pyx_string_tab[207]
3873
+ #define __pyx_n_u_self_multiply __pyx_string_tab[208]
3874
+ #define __pyx_n_u_send __pyx_string_tab[209]
3875
+ #define __pyx_n_u_set_name __pyx_string_tab[210]
3876
+ #define __pyx_n_u_setstate __pyx_string_tab[211]
3877
+ #define __pyx_n_u_setstate_cython __pyx_string_tab[212]
3878
+ #define __pyx_n_u_single_result __pyx_string_tab[213]
3879
+ #define __pyx_kp_u_src_ck_circuit__circuit_cy_pyx __pyx_string_tab[214]
3880
+ #define __pyx_n_u_state __pyx_string_tab[215]
3881
+ #define __pyx_n_u_str __pyx_string_tab[216]
3882
+ #define __pyx_kp_u_stringsource __pyx_string_tab[217]
3883
+ #define __pyx_n_u_sum __pyx_string_tab[218]
3884
+ #define __pyx_n_u_super __pyx_string_tab[219]
3885
+ #define __pyx_n_u_symbol __pyx_string_tab[220]
3886
+ #define __pyx_n_u_test __pyx_string_tab[221]
3887
+ #define __pyx_n_u_throw __pyx_string_tab[222]
3888
+ #define __pyx_n_u_to_add __pyx_string_tab[223]
3889
+ #define __pyx_n_u_to_mul __pyx_string_tab[224]
3890
+ #define __pyx_n_u_typing __pyx_string_tab[225]
3891
+ #define __pyx_n_u_update __pyx_string_tab[226]
3892
+ #define __pyx_n_u_use_setstate __pyx_string_tab[227]
3893
+ #define __pyx_n_u_value __pyx_string_tab[228]
3894
+ #define __pyx_n_u_values __pyx_string_tab[229]
3895
+ #define __pyx_kp_u_var __pyx_string_tab[230]
3896
+ #define __pyx_n_u_var_2 __pyx_string_tab[231]
3897
+ #define __pyx_n_u_var_name __pyx_string_tab[232]
3898
+ #define __pyx_n_u_var_names __pyx_string_tab[233]
3899
+ #define __pyx_kp_u_var_nodes __pyx_string_tab[234]
3900
+ #define __pyx_n_u_x __pyx_string_tab[235]
3901
+ #define __pyx_n_u_xs __pyx_string_tab[236]
3902
+ #define __pyx_n_u_xs_list __pyx_string_tab[237]
3903
+ #define __pyx_n_u_y __pyx_string_tab[238]
3904
+ #define __pyx_n_u_ys __pyx_string_tab[239]
3905
+ #define __pyx_n_u_ys_list __pyx_string_tab[240]
3906
+ #define __pyx_n_u_zero __pyx_string_tab[241]
3910
3907
  /* #### Code section: module_state_clear ### */
3911
3908
  #if CYTHON_USE_MODULE_STATE
3912
3909
  static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
@@ -3967,7 +3964,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
3967
3964
  Py_CLEAR(clear_module_state->__pyx_type_2ck_7circuit_11_circuit_cy___pyx_scope_struct_10_genexpr);
3968
3965
  for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
3969
3966
  for (int i=0; i<49; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3970
- for (int i=0; i<243; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3967
+ for (int i=0; i<242; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3971
3968
  Py_CLEAR(clear_module_state->__pyx_int_0);
3972
3969
  Py_CLEAR(clear_module_state->__pyx_int_1);
3973
3970
  Py_CLEAR(clear_module_state->__pyx_int_16976299);
@@ -4054,7 +4051,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void
4054
4051
  Py_VISIT(traverse_module_state->__pyx_type_2ck_7circuit_11_circuit_cy___pyx_scope_struct_10_genexpr);
4055
4052
  for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4056
4053
  for (int i=0; i<49; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4057
- for (int i=0; i<243; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4054
+ for (int i=0; i<242; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4058
4055
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
4059
4056
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
4060
4057
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_16976299);
@@ -8197,7 +8194,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
8197
8194
  static PyObject *__pyx_gb_2ck_7circuit_11_circuit_cy_7Circuit_4dump_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
8198
8195
 
8199
8196
  /* "ck/circuit/_circuit_cy.pyx":364
8200
- * for op in reversed(self.ops):
8197
+ * for op in self.ops:
8201
8198
  * op_name = node_name[id(op)]
8202
8199
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
8203
8200
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9276,7 +9273,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9276
9273
  * f'{prefix}op nodes: {self.number_of_op_nodes} '
9277
9274
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})' # <<<<<<<<<<<<<<
9278
9275
  * )
9279
- * for op in reversed(self.ops):
9276
+ * for op in self.ops:
9280
9277
  */
9281
9278
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_number_of_arcs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 360, __pyx_L1_error)
9282
9279
  __Pyx_GOTREF(__pyx_t_13);
@@ -9325,7 +9322,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9325
9322
  /* "ck/circuit/_circuit_cy.pyx":362
9326
9323
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
9327
9324
  * )
9328
- * for op in reversed(self.ops): # <<<<<<<<<<<<<<
9325
+ * for op in self.ops: # <<<<<<<<<<<<<<
9329
9326
  * op_name = node_name[id(op)]
9330
9327
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9331
9328
  */
@@ -9334,13 +9331,8 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9334
9331
  __PYX_ERR(0, 362, __pyx_L1_error)
9335
9332
  }
9336
9333
  __pyx_t_1 = __pyx_v_self->ops; __Pyx_INCREF(__pyx_t_1);
9337
- __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_t_1);
9338
- #if !CYTHON_ASSUME_SAFE_SIZE
9339
- if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 362, __pyx_L1_error)
9340
- #endif
9341
- --__pyx_t_8;
9334
+ __pyx_t_8 = 0;
9342
9335
  for (;;) {
9343
- if (__pyx_t_8 < 0) break;
9344
9336
  {
9345
9337
  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
9346
9338
  #if !CYTHON_ASSUME_SAFE_SIZE
@@ -9349,7 +9341,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9349
9341
  if (__pyx_t_8 >= __pyx_temp) break;
9350
9342
  }
9351
9343
  __pyx_t_14 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_8);
9352
- --__pyx_t_8;
9344
+ ++__pyx_t_8;
9353
9345
  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 362, __pyx_L1_error)
9354
9346
  __Pyx_GOTREF(__pyx_t_14);
9355
9347
  __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_14);
@@ -9357,7 +9349,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9357
9349
 
9358
9350
  /* "ck/circuit/_circuit_cy.pyx":363
9359
9351
  * )
9360
- * for op in reversed(self.ops):
9352
+ * for op in self.ops:
9361
9353
  * op_name = node_name[id(op)] # <<<<<<<<<<<<<<
9362
9354
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9363
9355
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9381,7 +9373,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9381
9373
  __pyx_t_2 = 0;
9382
9374
 
9383
9375
  /* "ck/circuit/_circuit_cy.pyx":364
9384
- * for op in reversed(self.ops):
9376
+ * for op in self.ops:
9385
9377
  * op_name = node_name[id(op)]
9386
9378
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
9387
9379
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9439,7 +9431,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9439
9431
  /* "ck/circuit/_circuit_cy.pyx":362
9440
9432
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
9441
9433
  * )
9442
- * for op in reversed(self.ops): # <<<<<<<<<<<<<<
9434
+ * for op in self.ops: # <<<<<<<<<<<<<<
9443
9435
  * op_name = node_name[id(op)]
9444
9436
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9445
9437
  */
@@ -28899,7 +28891,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = {
28899
28891
  {__pyx_k_remove_unreachable_op_nodes, sizeof(__pyx_k_remove_unreachable_op_nodes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove_unreachable_op_nodes */
28900
28892
  {__pyx_k_result, sizeof(__pyx_k_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result */
28901
28893
  {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */
28902
- {__pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reversed */
28903
28894
  {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */
28904
28895
  {__pyx_k_self_multiply, sizeof(__pyx_k_self_multiply), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self_multiply */
28905
28896
  {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */
@@ -28949,7 +28940,6 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
28949
28940
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 327, __pyx_L1_error)
28950
28941
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(0, 335, __pyx_L1_error)
28951
28942
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 355, __pyx_L1_error)
28952
- __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 362, __pyx_L1_error)
28953
28943
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 424, __pyx_L1_error)
28954
28944
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(0, 473, __pyx_L1_error)
28955
28945
  return 0;
@@ -29175,7 +29165,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
29175
29165
  __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_ck_circuit__circuit_cy_pyx, __pyx_mstate->__pyx_n_u_reachable_op_nodes, __pyx_k_2_4_AQ_t_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
29176
29166
  }
29177
29167
  {
29178
- const __Pyx_PyCode_New_function_description descr = {1, 0, 4, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304, 499};
29168
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 4, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304, 495};
29179
29169
  PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_indent, __pyx_mstate->__pyx_n_u_var_names, __pyx_mstate->__pyx_n_u_include_consts, __pyx_mstate->__pyx_n_u_next_prefix, __pyx_mstate->__pyx_n_u_node_name, __pyx_mstate->__pyx_n_u_var_2, __pyx_mstate->__pyx_n_u_var_name, __pyx_mstate->__pyx_n_u_const, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_op_name, __pyx_mstate->__pyx_n_u_args_str, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
29180
29170
  __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_ck_circuit__circuit_cy_pyx, __pyx_mstate->__pyx_n_u_dump, __pyx_k_A_Q_1_7_A_A_Qb_D_Qb_34q_Qb_0_A_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
29181
29171
  }
@@ -359,7 +359,7 @@ cdef class Circuit:
359
359
  f'{prefix}op nodes: {self.number_of_op_nodes} '
360
360
  f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
361
361
  )
362
- for op in reversed(self.ops):
362
+ for op in self.ops:
363
363
  op_name = node_name[id(op)]
364
364
  args_str = ' '.join(node_name[id(arg)] for arg in op.args)
365
365
  print(f'{next_prefix}{op_name}: {args_str}')
ck/circuit/_circuit_py.py CHANGED
@@ -413,7 +413,7 @@ class Circuit:
413
413
  f'{prefix}op nodes: {self.number_of_op_nodes} '
414
414
  f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
415
415
  )
416
- for op in reversed(self.ops):
416
+ for op in self.ops:
417
417
  op_name = node_name[id(op)]
418
418
  args_str = ' '.join(node_name[id(arg)] for arg in op.args)
419
419
  print(f'{next_prefix}{op_name}: {args_str}')