From f81aac9c1a1637013f001ee855cb077b3aac27b1 Mon Sep 17 00:00:00 2001 From: Nicolas Quesada Date: Thu, 19 Dec 2019 10:47:49 -0500 Subject: [PATCH] Updates bibliography --- paper.bib | 10 +- thewalrus/libwalrus.cpp | 456 +++++++++++++++++++++++++++++++++++----- 2 files changed, 411 insertions(+), 55 deletions(-) diff --git a/paper.bib b/paper.bib index 843c48bcb..9a2016141 100644 --- a/paper.bib +++ b/paper.bib @@ -66,7 +66,7 @@ @inproceedings{bjorklund2012 @article{kruse2018, - title = {Detailed study of Gaussian boson sampling}, + title = {Detailed study of {G}aussian boson sampling}, author = {Kruse, Regina and Hamilton, Craig S. and Sansoni, Linda and Barkhofen, Sonja and Silberhorn, Christine and Jex, Igor}, journal = {Physical Review A}, volume = {100}, @@ -91,7 +91,7 @@ @article{quesada2019 @article{quesada2019a, - title = {Simulating realistic non-Gaussian state preparation}, + title = {Simulating realistic non-{G}aussian state preparation}, author = {Quesada, N. and Helt, L. G. and Izaac, J. and Arrazola, J. M. and Shahrokhshahi, R. and Myers, C. R. and Sabapathy, K. K.}, journal = {Physical Review A}, volume = {100}, @@ -229,7 +229,7 @@ @article{killoran2019 } @article{kok2001, - title={Multi-dimensional Hermite polynomials in quantum optics}, + title={Multi-dimensional {H}ermite polynomials in quantum optics}, author={Kok, Pieter and Braunstein, Samuel L}, journal={Journal of Physics A: Mathematical and General}, volume={34}, @@ -240,14 +240,14 @@ @article{kok2001 } @article{wu2019speedup, - title={Speedup in Classical Simulation of Gaussian Boson Sampling}, + title={Speedup in Classical Simulation of {G}aussian Boson Sampling}, author={Wu, Bujiao and Cheng, Bin and Zhang, Jialin and Yung, Man-Hong and Sun, Xiaoming}, journal={arXiv preprint arXiv:1908.10070}, year={2019} } @article{valson2019franck, -title={Franck-Condon factors via compressive sensing}, +title={{F}ranck-{C}ondon factors via compressive sensing}, author={{Valson Jacob}, Kevin and {Kaur}, Eneet and {Roga}, Wojciech and {Takeoka}, Masahiro}, journal={arXiv preprint arXiv:1909.02935}, diff --git a/thewalrus/libwalrus.cpp b/thewalrus/libwalrus.cpp index 6c026ae74..8d4326650 100644 --- a/thewalrus/libwalrus.cpp +++ b/thewalrus/libwalrus.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.2 */ +/* Generated by Cython 0.29.4 */ /* BEGIN: Cython Metadata { @@ -22,7 +22,7 @@ "-fPIC", "-shared", "-fopenmp", - "-I/home/josh/.local/lib/python3.6/site-packages/numpy/core/include" + "-I/home/nicolas/.local/lib/python3.6/site-packages/numpy/core/include" ], "extra_link_args": [ "-fopenmp" @@ -30,7 +30,7 @@ "include_dirs": [ "thewalrus", "", - "/home/josh/.local/lib/python3.6/site-packages/numpy/core/include", + "/home/nicolas/.local/lib/python3.6/site-packages/numpy/core/include", "/usr/local/include/eigen3", "/usr/include/eigen3", "include" @@ -38,8 +38,7 @@ "language": "c++", "library_dirs": [ "/usr/lib", - "/usr/local/lib", - "/home/josh/.local/lib" + "/usr/local/lib" ], "name": "libwalrus", "sources": [ @@ -57,8 +56,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_2" -#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_ABI "0_29_4" +#define CYTHON_HEX_VERSION 0x001D04F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -462,7 +461,7 @@ class __Pyx_FakeReference { typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); - return 0; // PyThread_create_key reports success always + return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); @@ -485,7 +484,7 @@ static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } -#endif // TSS (Thread Specific Storage) API +#endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else @@ -1564,9 +1563,9 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif @@ -1906,6 +1905,7 @@ static PyObject *indirect_contiguous = 0; static int __pyx_memoryview_thread_locks_used; static PyThread_type_lock __pyx_memoryview_thread_locks[8]; static PyObject *__pyx_convert_vector_to_py___pyx_t_double_complex(const std::vector<__pyx_t_double_complex> &); /*proto*/ +static PyObject *__pyx_convert_vector_to_py_double(const std::vector &); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ static void *__pyx_align_pointer(void *, size_t); /*proto*/ static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ @@ -2060,6 +2060,7 @@ static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type ' static const char __pyx_k_hermite_multidimensional[] = "hermite_multidimensional"; static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_hermite_multidimensional_real[] = "hermite_multidimensional_real"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; @@ -2130,6 +2131,7 @@ static PyObject *__pyx_n_s_haf_real; static PyObject *__pyx_n_s_haf_rpt_complex; static PyObject *__pyx_n_s_haf_rpt_real; static PyObject *__pyx_n_s_hermite_multidimensional; +static PyObject *__pyx_n_s_hermite_multidimensional_real; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_import; @@ -2206,6 +2208,7 @@ static PyObject *__pyx_pf_9libwalrus_12haf_real(CYTHON_UNUSED PyObject *__pyx_se static PyObject *__pyx_pf_9libwalrus_14perm_complex(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_A, PyObject *__pyx_v_quad); /* proto */ static PyObject *__pyx_pf_9libwalrus_16perm_real(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_A, PyObject *__pyx_v_quad, PyObject *__pyx_v_fsum); /* proto */ static PyObject *__pyx_pf_9libwalrus_18hermite_multidimensional(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_R, __Pyx_memviewslice __pyx_v_y, int __pyx_v_cutoff, PyObject *__pyx_v_renorm); /* proto */ +static PyObject *__pyx_pf_9libwalrus_20hermite_multidimensional_real(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_R, __Pyx_memviewslice __pyx_v_y, int __pyx_v_cutoff, PyObject *__pyx_v_renorm); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ @@ -2288,11 +2291,12 @@ static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__41; -static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__26; @@ -2303,7 +2307,8 @@ static PyObject *__pyx_codeobj__34; static PyObject *__pyx_codeobj__36; static PyObject *__pyx_codeobj__38; static PyObject *__pyx_codeobj__40; -static PyObject *__pyx_codeobj__47; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__49; /* Late includes */ /* "libwalrus.pyx":56 @@ -4696,13 +4701,13 @@ static PyObject *__pyx_pf_9libwalrus_16perm_real(CYTHON_UNUSED PyObject *__pyx_s * # Batch hafnian * * def hermite_multidimensional(double complex[:, :] R, double complex[:] y, int cutoff, renorm=False): # <<<<<<<<<<<<<< - * """Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` + * r"""Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` * via the C++ libwalrus library. */ /* Python wrapper */ static PyObject *__pyx_pw_9libwalrus_19hermite_multidimensional(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_9libwalrus_18hermite_multidimensional[] = "hermite_multidimensional(double complex[:, :] R, double complex[:] y, int cutoff, renorm=False)\nReturns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)`\n via the C++ libwalrus library.\n\n Args:\n R (array[float64]): square matrix parametrizing the Hermite polynomial family\n y (array[float64]): vector argument of the Hermite polynomial\n cutoff (int): maximum size of the subindices in the Hermite polynomial\n renorm (bool): if ``True``, normalizes the returned multidimensional Hermite\n polynomials such that :math:`H_k^{(R)}(y)/\\prod(\\prod_i k_i!)`\n\n Returns:\n array[float64]: the multidimensional Hermite polynomials\n "; +static char __pyx_doc_9libwalrus_18hermite_multidimensional[] = "hermite_multidimensional(double complex[:, :] R, double complex[:] y, int cutoff, renorm=False)\nReturns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)`\n via the C++ libwalrus library.\n\n Args:\n R (array[float64]): square matrix parametrizing the Hermite polynomial family\n y (array[float64]): vector argument of the Hermite polynomial\n cutoff (int): maximum size of the subindices in the Hermite polynomial\n renorm (bool): if ``True``, normalizes the returned multidimensional Hermite\n polynomials such that :math:`H_k^{(R)}(y)/\\sqrt{\\prod(\\prod_i k_i!)}`\n\n Returns:\n array[float64]: the multidimensional Hermite polynomials\n "; static PyMethodDef __pyx_mdef_9libwalrus_19hermite_multidimensional = {"hermite_multidimensional", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9libwalrus_19hermite_multidimensional, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9libwalrus_18hermite_multidimensional}; static PyObject *__pyx_pw_9libwalrus_19hermite_multidimensional(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { __Pyx_memviewslice __pyx_v_R = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -4931,9 +4936,11 @@ static PyObject *__pyx_pf_9libwalrus_18hermite_multidimensional(CYTHON_UNUSED Py * y_mat.push_back(y[i]) * * return hermite_multidimensional_cpp(R_mat, y_mat, cutoff, ren) # <<<<<<<<<<<<<< + * + * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __pyx_convert_vector_to_py___pyx_t_double_complex(libwalrus::hermite_multidimensional_cpp(__pyx_v_R_mat, __pyx_v_y_mat, __pyx_v_cutoff, __pyx_v_ren)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_11 = __pyx_convert_vector_to_py___pyx_t_double_complex(libwalrus::hermite_multidimensional_cpp<__pyx_t_double_complex>(__pyx_v_R_mat, __pyx_v_y_mat, __pyx_v_cutoff, __pyx_v_ren)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_r = __pyx_t_11; __pyx_t_11 = 0; @@ -4943,7 +4950,7 @@ static PyObject *__pyx_pf_9libwalrus_18hermite_multidimensional(CYTHON_UNUSED Py * # Batch hafnian * * def hermite_multidimensional(double complex[:, :] R, double complex[:] y, int cutoff, renorm=False): # <<<<<<<<<<<<<< - * """Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` + * r"""Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` * via the C++ libwalrus library. */ @@ -4960,6 +4967,274 @@ static PyObject *__pyx_pf_9libwalrus_18hermite_multidimensional(CYTHON_UNUSED Py return __pyx_r; } +/* "libwalrus.pyx":402 + * + * + * def hermite_multidimensional_real(double [:, :] R, double [:] y, int cutoff, renorm=False): # <<<<<<<<<<<<<< + * r"""Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` + * via the C++ libwalrus library. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9libwalrus_21hermite_multidimensional_real(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_9libwalrus_20hermite_multidimensional_real[] = "hermite_multidimensional_real(double[:, :] R, double[:] y, int cutoff, renorm=False)\nReturns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)`\n via the C++ libwalrus library.\n\n Args:\n R (array[float64]): square matrix parametrizing the Hermite polynomial family\n y (array[float64]): vector argument of the Hermite polynomial\n cutoff (int): maximum size of the subindices in the Hermite polynomial\n renorm (bool): if ``True``, normalizes the returned multidimensional Hermite\n polynomials such that :math:`H_k^{(R)}(y)/\\sqrt{\\prod(\\prod_i k_i!)}`\n\n Returns:\n array[float64]: the multidimensional Hermite polynomials\n "; +static PyMethodDef __pyx_mdef_9libwalrus_21hermite_multidimensional_real = {"hermite_multidimensional_real", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9libwalrus_21hermite_multidimensional_real, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9libwalrus_20hermite_multidimensional_real}; +static PyObject *__pyx_pw_9libwalrus_21hermite_multidimensional_real(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_R = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_cutoff; + PyObject *__pyx_v_renorm = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("hermite_multidimensional_real (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_y,&__pyx_n_s_cutoff,&__pyx_n_s_renorm,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("hermite_multidimensional_real", 0, 3, 4, 1); __PYX_ERR(0, 402, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("hermite_multidimensional_real", 0, 3, 4, 2); __PYX_ERR(0, 402, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_renorm); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hermite_multidimensional_real") < 0)) __PYX_ERR(0, 402, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_R = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_R.memview)) __PYX_ERR(0, 402, __pyx_L3_error) + __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 402, __pyx_L3_error) + __pyx_v_cutoff = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_cutoff == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L3_error) + __pyx_v_renorm = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("hermite_multidimensional_real", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 402, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("libwalrus.hermite_multidimensional_real", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9libwalrus_20hermite_multidimensional_real(__pyx_self, __pyx_v_R, __pyx_v_y, __pyx_v_cutoff, __pyx_v_renorm); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9libwalrus_20hermite_multidimensional_real(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_R, __Pyx_memviewslice __pyx_v_y, int __pyx_v_cutoff, PyObject *__pyx_v_renorm) { + int __pyx_v_i; + int __pyx_v_j; + int __pyx_v_n; + std::vector __pyx_v_R_mat; + std::vector __pyx_v_y_mat; + int __pyx_v_ren; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("hermite_multidimensional_real", 0); + + /* "libwalrus.pyx":416 + * array[float64]: the multidimensional Hermite polynomials + * """ + * cdef int i, j, n = R.shape[0] # <<<<<<<<<<<<<< + * cdef vector[double] R_mat, y_mat + * + */ + __pyx_v_n = (__pyx_v_R.shape[0]); + + /* "libwalrus.pyx":419 + * cdef vector[double] R_mat, y_mat + * + * cdef int ren = 0 # <<<<<<<<<<<<<< + * + * if renorm: + */ + __pyx_v_ren = 0; + + /* "libwalrus.pyx":421 + * cdef int ren = 0 + * + * if renorm: # <<<<<<<<<<<<<< + * ren = 1 + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_renorm); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) + if (__pyx_t_1) { + + /* "libwalrus.pyx":422 + * + * if renorm: + * ren = 1 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_ren = 1; + + /* "libwalrus.pyx":421 + * cdef int ren = 0 + * + * if renorm: # <<<<<<<<<<<<<< + * ren = 1 + * + */ + } + + /* "libwalrus.pyx":424 + * ren = 1 + * + * for i in range(n): # <<<<<<<<<<<<<< + * for j in range(n): + * R_mat.push_back(R[i, j]) + */ + __pyx_t_2 = __pyx_v_n; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "libwalrus.pyx":425 + * + * for i in range(n): + * for j in range(n): # <<<<<<<<<<<<<< + * R_mat.push_back(R[i, j]) + * + */ + __pyx_t_5 = __pyx_v_n; + __pyx_t_6 = __pyx_t_5; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_j = __pyx_t_7; + + /* "libwalrus.pyx":426 + * for i in range(n): + * for j in range(n): + * R_mat.push_back(R[i, j]) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + try { + __pyx_v_R_mat.push_back((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_R.data + __pyx_t_8 * __pyx_v_R.strides[0]) ) + __pyx_t_9 * __pyx_v_R.strides[1]) )))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 426, __pyx_L1_error) + } + } + } + + /* "libwalrus.pyx":428 + * R_mat.push_back(R[i, j]) + * + * for i in range(n): # <<<<<<<<<<<<<< + * y_mat.push_back(y[i]) + * + */ + __pyx_t_2 = __pyx_v_n; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "libwalrus.pyx":429 + * + * for i in range(n): + * y_mat.push_back(y[i]) # <<<<<<<<<<<<<< + * + * return hermite_multidimensional_cpp(R_mat, y_mat, cutoff, ren) + */ + __pyx_t_10 = __pyx_v_i; + try { + __pyx_v_y_mat.push_back((*((double *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 429, __pyx_L1_error) + } + } + + /* "libwalrus.pyx":431 + * y_mat.push_back(y[i]) + * + * return hermite_multidimensional_cpp(R_mat, y_mat, cutoff, ren) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __pyx_convert_vector_to_py_double(libwalrus::hermite_multidimensional_cpp(__pyx_v_R_mat, __pyx_v_y_mat, __pyx_v_cutoff, __pyx_v_ren)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "libwalrus.pyx":402 + * + * + * def hermite_multidimensional_real(double [:, :] R, double [:] y, int cutoff, renorm=False): # <<<<<<<<<<<<<< + * r"""Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` + * via the C++ libwalrus library. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("libwalrus.hermite_multidimensional_real", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_R, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "vector.to_py":60 * * @cname("__pyx_convert_vector_to_py___pyx_t_double_complex") @@ -5024,6 +5299,60 @@ static PyObject *__pyx_convert_vector_to_py___pyx_t_double_complex(const std::ve return __pyx_r; } +static PyObject *__pyx_convert_vector_to_py_double(const std::vector &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "View.MemoryView":122 * cdef bint dtype_is_object * @@ -8591,8 +8920,8 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "View.MemoryView":432 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, @@ -9301,11 +9630,11 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview goto __pyx_L6_except_return; } __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":490 * try: @@ -11711,7 +12040,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_7 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -18570,6 +18899,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_haf_rpt_complex, __pyx_k_haf_rpt_complex, sizeof(__pyx_k_haf_rpt_complex), 0, 0, 1, 1}, {&__pyx_n_s_haf_rpt_real, __pyx_k_haf_rpt_real, sizeof(__pyx_k_haf_rpt_real), 0, 0, 1, 1}, {&__pyx_n_s_hermite_multidimensional, __pyx_k_hermite_multidimensional, sizeof(__pyx_k_hermite_multidimensional), 0, 0, 1, 1}, + {&__pyx_n_s_hermite_multidimensional_real, __pyx_k_hermite_multidimensional_real, sizeof(__pyx_k_hermite_multidimensional_real), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, @@ -18960,7 +19290,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * # Batch hafnian * * def hermite_multidimensional(double complex[:, :] R, double complex[:] y, int cutoff, renorm=False): # <<<<<<<<<<<<<< - * """Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` + * r"""Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` * via the C++ libwalrus library. */ __pyx_tuple__39 = PyTuple_Pack(10, __pyx_n_s_R, __pyx_n_s_y, __pyx_n_s_cutoff, __pyx_n_s_renorm, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_R_mat, __pyx_n_s_y_mat, __pyx_n_s_ren); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 370, __pyx_L1_error) @@ -18968,6 +19298,18 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__39); __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_thewalrus_libwalrus_pyx, __pyx_n_s_hermite_multidimensional, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 370, __pyx_L1_error) + /* "libwalrus.pyx":402 + * + * + * def hermite_multidimensional_real(double [:, :] R, double [:] y, int cutoff, renorm=False): # <<<<<<<<<<<<<< + * r"""Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` + * via the C++ libwalrus library. + */ + __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_R, __pyx_n_s_y, __pyx_n_s_cutoff, __pyx_n_s_renorm, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_R_mat, __pyx_n_s_y_mat, __pyx_n_s_ren); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_thewalrus_libwalrus_pyx, __pyx_n_s_hermite_multidimensional_real, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 402, __pyx_L1_error) + /* "View.MemoryView":286 * return self.name * @@ -18975,9 +19317,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "View.MemoryView":287 * @@ -18986,9 +19328,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef indirect = Enum("") * */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); /* "View.MemoryView":288 * cdef generic = Enum("") @@ -18997,9 +19339,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); /* "View.MemoryView":291 * @@ -19008,9 +19350,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); /* "View.MemoryView":292 * @@ -19019,19 +19361,19 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__46 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__48 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -19487,7 +19829,7 @@ if (!__Pyx_RefNanny) { * # Batch hafnian * * def hermite_multidimensional(double complex[:, :] R, double complex[:] y, int cutoff, renorm=False): # <<<<<<<<<<<<<< - * """Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` + * r"""Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` * via the C++ libwalrus library. */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9libwalrus_19hermite_multidimensional, NULL, __pyx_n_s_libwalrus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) @@ -19495,6 +19837,18 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_hermite_multidimensional, __pyx_t_1) < 0) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "libwalrus.pyx":402 + * + * + * def hermite_multidimensional_real(double [:, :] R, double [:] y, int cutoff, renorm=False): # <<<<<<<<<<<<<< + * r"""Returns the multidimensional Hermite polynomials :math:`H_k^{(R)}(y)` + * via the C++ libwalrus library. + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9libwalrus_21hermite_multidimensional_real, NULL, __pyx_n_s_libwalrus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hermite_multidimensional_real, __pyx_t_1) < 0) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "libwalrus.pyx":1 * # Copyright 2019 Xanadu Quantum Technologies Inc. # <<<<<<<<<<<<<< * @@ -19525,7 +19879,7 @@ if (!__Pyx_RefNanny) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_1); @@ -19539,7 +19893,7 @@ if (!__Pyx_RefNanny) { * cdef indirect = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_1); @@ -19553,7 +19907,7 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_1); @@ -19567,7 +19921,7 @@ if (!__Pyx_RefNanny) { * cdef indirect_contiguous = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_1); @@ -19581,7 +19935,7 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); @@ -21230,7 +21584,9 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { + (void)inplace; + (void)zerodivision_check; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; @@ -21919,7 +22275,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, theta = 0; } else { r = -a.real; - theta = atan2(0, -1); + theta = atan2(0.0, -1.0); } } else { r = __Pyx_c_abs_double(a);