Explore chapters and articles related to this topic
More on R/Python Programming
Published in Nailong Zhang, A Tour of Data Science, 2020
It’s worth noting the extension of the Cython file above is pyx, not py. And in Fibonacci.pyx, the function we defined follows the native Python syntax. But in Cython we can add static typing declarations which are often helpful to improve the performance, although not it’s mandatory. The keyword cdef makes the function Fibonacci_c invisible to Python and thus we have to define the Fibonacci_static function as a wrapper which can be imported into Python. The function Fibonacci is not static typed for benchmarking.
Computational model to conform aerodrome geometry to ICAO design standards
Published in Gianluca Dell’Acqua, Fred Wegman, Transport Infrastructure and Systems, 2017
The above criteria led the Python language to be selected. This is an interpreted, high-level, multi-paradigm, multi-platform programming language, promoted by the Python Software Foundation (PSF, 2016). Although computational performance is not deemed as a strong Python point, tools such as Cython allow speeding up execution, by means of a special compiling technique (Cython, 2016). Visualization can be generated by Python with the Matplotlib library and a GUI can be developed via wxPython toolkit, for example.
An alternative formulation of vibrational heat-bath configuration interaction
Published in Molecular Physics, 2021
Abuzar U. Bhatty, Kurt R. Brorsen
We have implemented our formulation of the VHCI method using Python. A locally modified PyPES code [61,65] was used to read in the force fields constants. Performance critical portions of the code were written in Cython and parallelisation was performed using OpenMP. Due to the use of Python dictionaries during step 5 of the variational stage, the speed up during this step from using Cython is much less than for constructing the Hamiltonian in step 6 as the performance increase using Cython is minimal when Python objects must be regularly accessed. It is very likely that the VHCI calculations in this study would be faster when performed using a lower-level language such as C, C++, or Fortran. However, even when using a higher-level language, the calculations in this study are competitive with previous VHCI calculations implemented using lower-level language. All calculations were performed using Intel Xeon Gold 5138 2.00 GHz CPUs.