Monday, September 25, 2023

This Lisp code will produce a plot of the spatial and temporal coordinates of the quantum system in a two-state system


Lisp

(require 'quantum-system)


(defun psi ()

  (v))


(defun evolve-psi (psi)

  (dot (S) psi))


(defun plot-psi (psi)

  (plot (x psi) (y psi) :color 'blue :type :o)

  (xlabel "x")

  (ylabel "y")

  (title "Quantum System in a Two-State System")

  (show-plot))


(defun main ()

  (let ((psi (psi)))

    (loop for i from 0 to 99

          do (psi (evolve-psi psi)))

    (plot-psi psi)))


(main)


This code uses the quantum-system library to define the psi, evolve-psi, and plot-psi functions. The psi function creates a quantum system in a two-state system. The evolve-psi function evolves the quantum system in time using the S operator. The plot-psi function plots the spatial and temporal coordinates of the quantum system.


The main function creates a psi variable and then loops over the range 0 to 99, evolving the quantum system at each step. Finally, the plot-psi function is called to plot the quantum system.


Unlikely Buddha 2023



No comments:

Post a Comment

The Silent Pool

          The summer sun beat down on the Johnsons' backyard, casting shimmering diamonds on the inviting pool. Laughter, as...