Large Integer Packages by James Pate Williams Jr

Back in the late 1990s I trained myself in number theory and cryptography using the “Handbook of Applied Cryptography” by Alfred J. Menezes and his coeditors and the FreeLIP (Free Large Integer Package) package by Arjen K. Lenstra. FreeLIP is quite an elegant C library, but it is now considered obsolete. I know of MIRACL that was Henri Cohen’s favorite large integer library. I have four books in my personal library that have unsigned or signed multiple precision integer arithmetic code and/or algorithms: “A Numerical Library in C for Scientists and Engineers” by H .T. Lau, “Handbook of Applied Cryptography”, “Prime Numbers and Computer Methods of Factorization Second Edition” by Hans Riesel, and “Semi-numerical Algorithms Second Edition” by Donald Knuth. I also have several number theory and cryptography textbooks.

As an exercise in Python console programming, I translated my C# Visual Studio 2008 large integer code to Python. Back in 2008 Visual Studio C# did not support large integers. I used Riesel’s input and output code which was translated from Pascal code. I also utilized algorithms from the “Handbook of Applied Cryptography”. I included Sieve of Eratosthenes for primes <= 100,000, a trial division factoring algorithm, and programmed the Pollard rho factoring algorithm found in the handbook.

My Deepening Understanding of Numerical Analysis and Computer Programming by James Pate Williams Jr Blog Entry 01 11 2022

I have had three formal courses in elementary numerical analysis: one at Georgia Tech and two at LaGrange College. All three of these courses were targeting the undergraduate/graduate students at the institutions. The course at Georgia Tech was Scientific Computing I and was taught by Professor Gunter Meyer in the Summer Quarter of 1982. The other two courses were taught by Professor Fay A. Riddle. One of the LC courses was in Fall Quarter 1986 and the other was taught in Fall Quarter 1991. I had a mental break from reality in 1986 and I wound up in the Bradley Center in Columbus, GA for a few months’ hospitalization. I made the grades: B, C, and A respectively. I have done a lot of numerically based computer programming primarily in the Dayton BASIC, FORTRAN IV, and DG Pascal in the era: 1978 to 1980. I entered Georgia Tech in Fall 1980, so I was just able to work on the LC Data General Eclipse minicomputer on some weekends. I was deathly afraid of the Control Data Corporations Cyber supercomputer on the campus of Georgia Tech. The chairperson of the Chemistry Department, Professor Bertrand at Georgia Tech unsuccessfully tried to convince to use the Data General Eclipse minicomputer in the x-ray crystallography lab in the Boggs Chemistry Department building.

In the late 1980s I advanced to doing numerical computing on my first microcomputer, a Commodore Amiga 2000, which came into my life on Saturday, April 30, 1988. I used this machine until late 1994 when I acquired a mom-and-pop store Microsoft Intel personal computer. The Commodore Amiga languages I used were Microsoft Amiga BASIC, Modula-2, and Pecan Pascal. The languages on my first PC were Borland C++ and Borland Turbo Pascal.

I seem to recall that I transitioned to a Dell personal computer in 1998 and was using Visual Studio 6 in the C++ language. I used this computer along with another Dell personal computer which was purchased in 2002. I started programming in Java in the summer of 1999 when I took a course in object-oriented computer languages featuring the Sun Microcomputers version of Java. The Java course was taught by Professor Homer Carlisle who later became a doctoral faculty advisor of mine.

There was a lull in my numerical analytic software development during the late 1990s until the mid- 2000s. That period was the time required for me to earn a Master of Software Engineering and Doctor of Philosophy in Computer Science in Summer 2000 (August) and Fall 2005 (December) at Auburn University, respectively. I bought an Apple Power Mac with dual G5 IBM 64-bit microprocessors in December 2004. Unfortunately, it did not survive until about 2008 to 2009. In 2009, I bought a Dell computer running a CoreI7 processor and Vista Ultimate operating system along the software: Microsoft Visual Studio 2008 Professional and Cakewalk SONAR 8 Producer Edition.

I started doing a lot of software development covering a wide range of the spectra of computer algorithms in February 2015. These projects in Visual Studio 2008 and later Visual Studio 2015 were uploaded to the defunct Microsoft TechNet Forum and Gallery. I think I had around 250 projects in Vanilla C, Win32 C, Win32 C++, and C#. I bought my last Dell personal computer in December 2015. I do have a fair recently purchased Dell notebook computer.

Currently, I am teaching myself Python and I hope later to expand my knowledge of JavaScript.

Python Code to Implement the Linear Algebraic Rule by Cramer for a 3 by 3 Set of Linear Equations by James Pate Williams Jr

The algebraic example comes from the website:

Cramers Rule Calculator (ncalculators.com)

Quadratic, Cubic, and Quartic Python Equation Solver by James Pate Williams Jr

Back in 2015 I created a C# application to solve quadratic, cubic, and quartic equations which are of degrees 2, 3, and 4, respectively. Yesterday I successfully translated the C# to the Python console. I bench-marked my computer programs against the online calculators on the following website:

Cubic equation Calculator – High accuracy calculation (casio.com)

Quartic equation Calculator – High accuracy calculation (casio.com)

Here are my resulting Python outputs:

Three Term Recurrence Relations for the Legendre Functions by James Pate Williams, Jr.

bachelorthesis.dvi (uni-ulm.de)

My implementations and additional graphs for the Legendre functions mentioned in the thesis cited in the preceding line and PDF. The Legendre polynomials, functions, and associated functions have many applications in quantum mechanics and other branches of applied and theoretical physics.

Legendre Functions Application
Magnitude Graph for P(z, 8)
Imaginary Part for P(z, 8)
Real Part for P(z, 8)
Magnitudes of Q(z, 8)
Imaginary Part of Q(z, 8)
Real Part of Q(z, 8)
Graph of P(cos x, 8) Real Valued Function
Graph of Q(cos x, 8) Real Valued Function
Graph of P(x, 8) Real Valued Function
Graph of Q(x, 8) Real Valued Function
P(cos x, 30)
Q(cos x, 30)
P(x, 30)
Q(x, 30)

Iterative Deepening A* Search to Solve the 8-Puzzle and 15-Puzzle by James Pate Williams, Jr.

The 8-puzzle is a child’s tiled toy. The toy consists of 8 numbered tiles and a blank space. The object of the game is to get the tiles in the order 1 to 8 going from the top left hand corner for the number 1 tile around the perimeter clockwise and finish with the space in the center of the 3 x 3 board.

A* search is a complete and optimal informed or heuristic search algorithm. A good source for information on uniformed and informed search procedures is the tome “Artificial Intelligence A Modern Approach First and/or Second Edition” by Stuart Russell and Peter Norvig. The second edition has more info on the 8-puzzle and the 15-puzzle. Iterative deepening A* search is also a complete and optimal search algorithm. Below is an instance of the 8-puzzle that requires 10 steps to reach the goal state. I use a different goal state than Russell and Norvig in the second edition of their textbook.

Initial State of a 8-Puzzle Instance
Goal State of a 8-Puzzle Instance
Initial State of a 15-Puzzle Instance
Goal State of a 15-Puzzle Instance

I developed an application in 2015 that uses 5 search algorithms to solve instances of the 15-puzzle.

Best First Search Algorithm
Breadth First Search Algorithm
Failure of Depth First Algorithm
Failure of IDA* Search
Failure of the A* Search
Best First Search
Failure of Breadth First Search
Failure of Depth First Search
IDA* Search Solution
A* Search Solution

First Order Perturbation Calculation for the Helium Atom Ground State by James Pate Williams, Jr.

The first order perturbation calculation for the helium atom ground state is treated in detail in the textbook “Quantum Mechanics Third Edition” by Leonard I. Schiff pages 257 to 259. I offer a numerical algorithm for computing the electron-electron repulsion interaction which is analytically determined by Schiff and other scientists. Next is the graphical user interface for the application  and its output.

Application Graphical User Interface

The Ep text box is the ground state energy as found by a first order perturbation computation. The Ee text box is the experimental ground state energy. The IA text box is the analytic electron-electron repulsion interaction determined by Schiff and other quantum mechanics researchers. The IC text box is my numerical contribution. All the energies are in electron volts.

The application source code are the next items in this blog.

Experimental Computational Quantum Chemistry and Quantum Mechanics by James Pate Williams, Jr.

In my current return to my youthful dual interests in quantum chemistry and quantum mechanics that occupied much of my time in the 1960s, 1970s and 1980s, I am now using my knowledge of experimental numerical analysis. My interest in computer science and numerical analysis began in the summer of 1976 while I was a chemistry student at my local college namely LaGrange College in LaGrange, Georgia. As a child and teenager I was very interested in several disciplines of physics: classical mechanics, quantum mechanics, and the theories of special and general relativity. Later I added to my knowledge toolkit some tidbits of statistical mechanics and statistical thermodynamics.

This blog entry will explore the wonderful world of the hydrogenic atom which used to known by the moniker, hydrogen-like atom. The most well known isotope of hydrogen has one electron and one proton and its atomic number is 1 and it is sometimes denoted by the letter and numeral Z = 1. Of course, there are multiple other isotopes of hydrogen including deuterium (one proton and one neutron) and tritium (one proton and two neutrons). Hydrogen is the only atom whose wave functions both non-relativistic (see Erwin Schrödinger) and relativistic (view Paul Adrian Maurice Dirac) have analytic close formed solutions. Hydrogen is the most abundant chemical element on Earth and in the universe. The stars initially use a hydrogen plasma as a nuclear fuel to create more massive atomic ions and release massive amounts of nuclear fusion energy.

Way back in the 1920s Erwin Schrödinger decided to apply his work in wave hydrology to the newly found branch of physics known as quantum theory and quantum mechanics. From his work the branch of quantum mechanics known as wave quantum mechanics evolved. This branch was as important as another competing theory of quantum mechanics known as matrix quantum mechanics that was being concurrently developed by Werner Heisenberg. The key process in the derivation of a Schrödinger equation for any time independent scenario is to apply the first quantization rules to a valid classical Hamiltonian. The classical Hamiltonian is the total energy of a system and is the sum of the kinetic energy and the potential energy. The classical Hamiltonian for the hydrogen-like atom is shown in equation (1).

Equation (1), Many Sources

The first quantization rule is to apply the conversion from a classical momentum vector to a momentum quantum mechanical operator using the equation (2).

Equation (2), Several Sources

The lower case m is the mass of the electron and the upper case M is the mass of the atomic nucleus which is the Z times the proton mass plus the number of neutrons times the neutron mass. The Greek letter mu is the reduced mass of the hydrogen-like system. The italic i is the imaginary unit that is the square root of the number -1. The transcendental number pi is represented by the Greek letter pi and has the truncated real number value of 3.1415926535897932384626433832795. Schrödinger plugged Equation (2) into Equation (1) and found a three-dimensional Cartesian coordinate second order partial differential equation (3) that used the operator discovered by the mathematician Laplace.

Equation (3), Merzbacher, Messiah, Schiff Et. Al.
Equation (4), Several Sources

In equation (4) the first partial differential operator is the Laplace operator which is the vector inner product of the three-dimensional Cartesian gradient operator from vector analysis. The scalar r in equation (4) is the Euclidean distance from the electron to the nucleus. The Greek letter psi (“pitchfork”) in equation (3) is the illustrious and elusive wave function.

The first thing that struck Schrödinger was that the equation (3) that he derived by much thought was unfortunately not a separable partial differential equation in three-dimensional Cartesian coordinates, however, he next applied a coordinate coordinate transformation from three-dimensional Cartesian coordinates to three dimensional spherical polar equations specified by the equations in the following PDF with some derivations.

The wave function for the hydrogen-like atom is dependent on the associated Laguerre polynomials and the spherical harmonics that dependent upon the associated Legendre functions.

https://mathworld.wolfram.com/AssociatedLaguerrePolynomial.html

https://www.sciencedirect.com/topics/mathematics/associated-legendre-function

I created a useful C# desktop application that allows some graphical exploration of the hydrogen-like atom. Here is the graphical user interface.

Tool for Exploring the Hydrogen-Like Atom

The PDF file below are graphs for the radial wave functions for the hydrogen-like atom for n = 1 to 8 which are the s-orbitals.

Polarizability of the Hydrogen Atom Ground State Calculated Using Second Order Perturbation Theory
Second Order Perturbation Theory Terms