compiled-knowledge 4.0.0a21__cp313-cp313-musllinux_1_2_x86_64.whl → 4.0.0a23__cp313-cp313-musllinux_1_2_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 (30) hide show
  1. ck/circuit/_circuit_cy.c +50 -60
  2. ck/circuit/_circuit_cy.cpython-313-x86_64-linux-musl.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-313-x86_64-linux-musl.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/llvm_ir_function.py +18 -1
  14. ck/pgm.py +1 -1
  15. ck/pgm_circuit/mpe_program.py +2 -2
  16. ck/pgm_circuit/support/compile_circuit.py +4 -7
  17. ck/pgm_compiler/named_pgm_compilers.py +0 -3
  18. ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c +1 -1
  19. ck/pgm_compiler/support/clusters.py +8 -4
  20. ck/program/raw_program.py +41 -9
  21. ck/utils/np_extras.py +5 -5
  22. ck_demos/ace/simple_ace_demo.py +18 -0
  23. ck_demos/getting_started/__init__.py +0 -0
  24. ck_demos/getting_started/simple_demo.py +18 -0
  25. ck_demos/programs/demo_raw_program_dump.py +17 -0
  26. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/METADATA +1 -1
  27. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/RECORD +30 -26
  28. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/WHEEL +0 -0
  29. {compiled_knowledge-4.0.0a21.dist-info → compiled_knowledge-4.0.0a23.dist-info}/licenses/LICENSE.txt +0 -0
  30. {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
@@ -10,7 +10,7 @@
10
10
  ]
11
11
  ],
12
12
  "include_dirs": [
13
- "/tmp/build-env-kg5tvgow/lib/python3.12/site-packages/numpy/_core/include"
13
+ "/tmp/build-env-cfss913n/lib/python3.12/site-packages/numpy/_core/include"
14
14
  ],
15
15
  "name": "ck.circuit._circuit_cy",
16
16
  "sources": [
@@ -1764,7 +1764,7 @@ struct __pyx_obj_2ck_7circuit_11_circuit_cy___pyx_scope_struct_6_dump {
1764
1764
 
1765
1765
 
1766
1766
  /* "ck/circuit/_circuit_cy.pyx":364
1767
- * for op in reversed(self.ops):
1767
+ * for op in self.ops:
1768
1768
  * op_name = node_name[id(op)]
1769
1769
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
1770
1770
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -3042,7 +3042,6 @@ static PyObject *__pyx_builtin_range;
3042
3042
  static PyObject *__pyx_builtin_print;
3043
3043
  static PyObject *__pyx_builtin_id;
3044
3044
  static PyObject *__pyx_builtin_enumerate;
3045
- static PyObject *__pyx_builtin_reversed;
3046
3045
  static PyObject *__pyx_builtin_RuntimeError;
3047
3046
  static PyObject *__pyx_builtin_super;
3048
3047
  /* #### Code section: string_decls ### */
@@ -3181,7 +3180,6 @@ static const char __pyx_k_op_nodes[] = "op nodes: ";
3181
3180
  static const char __pyx_k_overload[] = "overload";
3182
3181
  static const char __pyx_k_pyx_type[] = "__pyx_type";
3183
3182
  static const char __pyx_k_qualname[] = "__qualname__";
3184
- static const char __pyx_k_reversed[] = "reversed";
3185
3183
  static const char __pyx_k_set_name[] = "__set_name__";
3186
3184
  static const char __pyx_k_setstate[] = "__setstate__";
3187
3185
  static const char __pyx_k_var_name[] = "var_name";
@@ -3320,7 +3318,7 @@ static const char __pyx_k_T_a_G1F_a_vWA_q_t87_s_fG1_q_d_7[] = "\200\001\360\010\
3320
3318
  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";
3321
3319
  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";
3322
3320
  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";
3323
- 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";
3321
+ 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";
3324
3322
  static const char __pyx_k_Circuit_remove_derivatives_cache[] = "Circuit.remove_derivatives_cache";
3325
3323
  static const char __pyx_k_Circuit_remove_unreachable_op_no[] = "Circuit.remove_unreachable_op_nodes";
3326
3324
  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))";
@@ -3535,7 +3533,7 @@ typedef struct {
3535
3533
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3536
3534
  PyObject *__pyx_tuple[8];
3537
3535
  PyObject *__pyx_codeobj_tab[49];
3538
- PyObject *__pyx_string_tab[243];
3536
+ PyObject *__pyx_string_tab[242];
3539
3537
  PyObject *__pyx_int_0;
3540
3538
  PyObject *__pyx_int_1;
3541
3539
  PyObject *__pyx_int_16976299;
@@ -3866,42 +3864,41 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati
3866
3864
  #define __pyx_n_u_remove_unreachable_op_nodes __pyx_string_tab[204]
3867
3865
  #define __pyx_n_u_result __pyx_string_tab[205]
3868
3866
  #define __pyx_n_u_return __pyx_string_tab[206]
3869
- #define __pyx_n_u_reversed __pyx_string_tab[207]
3870
- #define __pyx_n_u_self __pyx_string_tab[208]
3871
- #define __pyx_n_u_self_multiply __pyx_string_tab[209]
3872
- #define __pyx_n_u_send __pyx_string_tab[210]
3873
- #define __pyx_n_u_set_name __pyx_string_tab[211]
3874
- #define __pyx_n_u_setstate __pyx_string_tab[212]
3875
- #define __pyx_n_u_setstate_cython __pyx_string_tab[213]
3876
- #define __pyx_n_u_single_result __pyx_string_tab[214]
3877
- #define __pyx_kp_u_src_ck_circuit__circuit_cy_pyx __pyx_string_tab[215]
3878
- #define __pyx_n_u_state __pyx_string_tab[216]
3879
- #define __pyx_n_u_str __pyx_string_tab[217]
3880
- #define __pyx_kp_u_stringsource __pyx_string_tab[218]
3881
- #define __pyx_n_u_sum __pyx_string_tab[219]
3882
- #define __pyx_n_u_super __pyx_string_tab[220]
3883
- #define __pyx_n_u_symbol __pyx_string_tab[221]
3884
- #define __pyx_n_u_test __pyx_string_tab[222]
3885
- #define __pyx_n_u_throw __pyx_string_tab[223]
3886
- #define __pyx_n_u_to_add __pyx_string_tab[224]
3887
- #define __pyx_n_u_to_mul __pyx_string_tab[225]
3888
- #define __pyx_n_u_typing __pyx_string_tab[226]
3889
- #define __pyx_n_u_update __pyx_string_tab[227]
3890
- #define __pyx_n_u_use_setstate __pyx_string_tab[228]
3891
- #define __pyx_n_u_value __pyx_string_tab[229]
3892
- #define __pyx_n_u_values __pyx_string_tab[230]
3893
- #define __pyx_kp_u_var __pyx_string_tab[231]
3894
- #define __pyx_n_u_var_2 __pyx_string_tab[232]
3895
- #define __pyx_n_u_var_name __pyx_string_tab[233]
3896
- #define __pyx_n_u_var_names __pyx_string_tab[234]
3897
- #define __pyx_kp_u_var_nodes __pyx_string_tab[235]
3898
- #define __pyx_n_u_x __pyx_string_tab[236]
3899
- #define __pyx_n_u_xs __pyx_string_tab[237]
3900
- #define __pyx_n_u_xs_list __pyx_string_tab[238]
3901
- #define __pyx_n_u_y __pyx_string_tab[239]
3902
- #define __pyx_n_u_ys __pyx_string_tab[240]
3903
- #define __pyx_n_u_ys_list __pyx_string_tab[241]
3904
- #define __pyx_n_u_zero __pyx_string_tab[242]
3867
+ #define __pyx_n_u_self __pyx_string_tab[207]
3868
+ #define __pyx_n_u_self_multiply __pyx_string_tab[208]
3869
+ #define __pyx_n_u_send __pyx_string_tab[209]
3870
+ #define __pyx_n_u_set_name __pyx_string_tab[210]
3871
+ #define __pyx_n_u_setstate __pyx_string_tab[211]
3872
+ #define __pyx_n_u_setstate_cython __pyx_string_tab[212]
3873
+ #define __pyx_n_u_single_result __pyx_string_tab[213]
3874
+ #define __pyx_kp_u_src_ck_circuit__circuit_cy_pyx __pyx_string_tab[214]
3875
+ #define __pyx_n_u_state __pyx_string_tab[215]
3876
+ #define __pyx_n_u_str __pyx_string_tab[216]
3877
+ #define __pyx_kp_u_stringsource __pyx_string_tab[217]
3878
+ #define __pyx_n_u_sum __pyx_string_tab[218]
3879
+ #define __pyx_n_u_super __pyx_string_tab[219]
3880
+ #define __pyx_n_u_symbol __pyx_string_tab[220]
3881
+ #define __pyx_n_u_test __pyx_string_tab[221]
3882
+ #define __pyx_n_u_throw __pyx_string_tab[222]
3883
+ #define __pyx_n_u_to_add __pyx_string_tab[223]
3884
+ #define __pyx_n_u_to_mul __pyx_string_tab[224]
3885
+ #define __pyx_n_u_typing __pyx_string_tab[225]
3886
+ #define __pyx_n_u_update __pyx_string_tab[226]
3887
+ #define __pyx_n_u_use_setstate __pyx_string_tab[227]
3888
+ #define __pyx_n_u_value __pyx_string_tab[228]
3889
+ #define __pyx_n_u_values __pyx_string_tab[229]
3890
+ #define __pyx_kp_u_var __pyx_string_tab[230]
3891
+ #define __pyx_n_u_var_2 __pyx_string_tab[231]
3892
+ #define __pyx_n_u_var_name __pyx_string_tab[232]
3893
+ #define __pyx_n_u_var_names __pyx_string_tab[233]
3894
+ #define __pyx_kp_u_var_nodes __pyx_string_tab[234]
3895
+ #define __pyx_n_u_x __pyx_string_tab[235]
3896
+ #define __pyx_n_u_xs __pyx_string_tab[236]
3897
+ #define __pyx_n_u_xs_list __pyx_string_tab[237]
3898
+ #define __pyx_n_u_y __pyx_string_tab[238]
3899
+ #define __pyx_n_u_ys __pyx_string_tab[239]
3900
+ #define __pyx_n_u_ys_list __pyx_string_tab[240]
3901
+ #define __pyx_n_u_zero __pyx_string_tab[241]
3905
3902
  /* #### Code section: module_state_clear ### */
3906
3903
  #if CYTHON_USE_MODULE_STATE
3907
3904
  static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
@@ -3962,7 +3959,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
3962
3959
  Py_CLEAR(clear_module_state->__pyx_type_2ck_7circuit_11_circuit_cy___pyx_scope_struct_10_genexpr);
3963
3960
  for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
3964
3961
  for (int i=0; i<49; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3965
- for (int i=0; i<243; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3962
+ for (int i=0; i<242; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3966
3963
  Py_CLEAR(clear_module_state->__pyx_int_0);
3967
3964
  Py_CLEAR(clear_module_state->__pyx_int_1);
3968
3965
  Py_CLEAR(clear_module_state->__pyx_int_16976299);
@@ -4049,7 +4046,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void
4049
4046
  Py_VISIT(traverse_module_state->__pyx_type_2ck_7circuit_11_circuit_cy___pyx_scope_struct_10_genexpr);
4050
4047
  for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4051
4048
  for (int i=0; i<49; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4052
- for (int i=0; i<243; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4049
+ for (int i=0; i<242; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4053
4050
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
4054
4051
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
4055
4052
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_16976299);
@@ -8192,7 +8189,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
8192
8189
  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 */
8193
8190
 
8194
8191
  /* "ck/circuit/_circuit_cy.pyx":364
8195
- * for op in reversed(self.ops):
8192
+ * for op in self.ops:
8196
8193
  * op_name = node_name[id(op)]
8197
8194
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
8198
8195
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9271,7 +9268,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9271
9268
  * f'{prefix}op nodes: {self.number_of_op_nodes} '
9272
9269
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})' # <<<<<<<<<<<<<<
9273
9270
  * )
9274
- * for op in reversed(self.ops):
9271
+ * for op in self.ops:
9275
9272
  */
9276
9273
  __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)
9277
9274
  __Pyx_GOTREF(__pyx_t_13);
@@ -9320,7 +9317,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9320
9317
  /* "ck/circuit/_circuit_cy.pyx":362
9321
9318
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
9322
9319
  * )
9323
- * for op in reversed(self.ops): # <<<<<<<<<<<<<<
9320
+ * for op in self.ops: # <<<<<<<<<<<<<<
9324
9321
  * op_name = node_name[id(op)]
9325
9322
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9326
9323
  */
@@ -9329,13 +9326,8 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9329
9326
  __PYX_ERR(0, 362, __pyx_L1_error)
9330
9327
  }
9331
9328
  __pyx_t_1 = __pyx_v_self->ops; __Pyx_INCREF(__pyx_t_1);
9332
- __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_t_1);
9333
- #if !CYTHON_ASSUME_SAFE_SIZE
9334
- if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 362, __pyx_L1_error)
9335
- #endif
9336
- --__pyx_t_8;
9329
+ __pyx_t_8 = 0;
9337
9330
  for (;;) {
9338
- if (__pyx_t_8 < 0) break;
9339
9331
  {
9340
9332
  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
9341
9333
  #if !CYTHON_ASSUME_SAFE_SIZE
@@ -9344,7 +9336,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9344
9336
  if (__pyx_t_8 >= __pyx_temp) break;
9345
9337
  }
9346
9338
  __pyx_t_14 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_8);
9347
- --__pyx_t_8;
9339
+ ++__pyx_t_8;
9348
9340
  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 362, __pyx_L1_error)
9349
9341
  __Pyx_GOTREF(__pyx_t_14);
9350
9342
  __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_14);
@@ -9352,7 +9344,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9352
9344
 
9353
9345
  /* "ck/circuit/_circuit_cy.pyx":363
9354
9346
  * )
9355
- * for op in reversed(self.ops):
9347
+ * for op in self.ops:
9356
9348
  * op_name = node_name[id(op)] # <<<<<<<<<<<<<<
9357
9349
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9358
9350
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9376,7 +9368,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9376
9368
  __pyx_t_2 = 0;
9377
9369
 
9378
9370
  /* "ck/circuit/_circuit_cy.pyx":364
9379
- * for op in reversed(self.ops):
9371
+ * for op in self.ops:
9380
9372
  * op_name = node_name[id(op)]
9381
9373
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
9382
9374
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9434,7 +9426,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9434
9426
  /* "ck/circuit/_circuit_cy.pyx":362
9435
9427
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
9436
9428
  * )
9437
- * for op in reversed(self.ops): # <<<<<<<<<<<<<<
9429
+ * for op in self.ops: # <<<<<<<<<<<<<<
9438
9430
  * op_name = node_name[id(op)]
9439
9431
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9440
9432
  */
@@ -28894,7 +28886,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = {
28894
28886
  {__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 */
28895
28887
  {__pyx_k_result, sizeof(__pyx_k_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result */
28896
28888
  {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */
28897
- {__pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reversed */
28898
28889
  {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */
28899
28890
  {__pyx_k_self_multiply, sizeof(__pyx_k_self_multiply), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self_multiply */
28900
28891
  {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */
@@ -28944,7 +28935,6 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
28944
28935
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 327, __pyx_L1_error)
28945
28936
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(0, 335, __pyx_L1_error)
28946
28937
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 355, __pyx_L1_error)
28947
- __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 362, __pyx_L1_error)
28948
28938
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 424, __pyx_L1_error)
28949
28939
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(0, 473, __pyx_L1_error)
28950
28940
  return 0;
@@ -29170,7 +29160,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
29170
29160
  __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;
29171
29161
  }
29172
29162
  {
29173
- const __Pyx_PyCode_New_function_description descr = {1, 0, 4, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304, 499};
29163
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 4, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304, 495};
29174
29164
  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};
29175
29165
  __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;
29176
29166
  }
@@ -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}')