Sunday, September 15, 2024

Plotting_It

 Had my probabilities this morning; getting a bar graph plot out with labels was

another matter...

                                                                      



I need to get beyond all this, tomorrow...


Splash

                                                                                  



Saturday, September 14, 2024

Calculate

 It might well be easier for me to do this manually but - Hello - this is

the computer age and I'm going for reusable code. This is the problem:


You

I have 13 results for 4 qubits in pairs. Each qubit could be either 1 or 0. Can 

python batch process the binomial probability on these?


Copilot

Yes, Python can batch process the binomial probability for your 13 results of 4 qubits. 

Here’s a sample code snippet to help you get started:


from scipy.stats import binom

# Number of trials (4 qubits)
n = 4
# Probability of success on a single trial (assuming equal probability for 0 and 1)
p = 0.5

# List of results (pairs of qubits)
results = [
    (0, 1, 0, 1),
    (1, 0, 1, 0),
    (1, 1, 0, 0),
    # Add the rest of your results here
]

# Calculate binomial probabilities for each result
probabilities = []
for result in results:
    k = sum(result)  # Number of successes (1s) in the result
    prob = binom.pmf(k, n, p)
    probabilities.append(prob)

# Print the results
for result, prob in zip(results, probabilities):
    print(f'Result: {result}, P(X={sum(result)}) = {prob:.4f}')
                          *     *     *












Ihttps://www.meta.ai/c/e011e9ed-af14-47d5-89dc-27d0cc145341 have 13 results for 4 qubits in pairs. Each qubit could be either 1 or 0. Can python batch process the binomial probability on these?I have 13 results for 4 qubits in pairs. Each qubit could be either 1 or 0. Can python batch process the binomial probability on these?I have 13 results for 4 qubits in pairs. Each qubit could be either 1 or 0. Can pyrhon batch process the binomial probability on these?I have 13 results for 4 qubits in pairs. Each qubit could be either 1 or 0. Can pyrhon batch process the binomial probability on these?I have 13 results for 4 qubits in pairs. Each qubit could be either 1 or 0. Can pyrhon batch process the binomial probability on these?


Friday, September 13, 2024

SVA

 Was intrigued to read about a new Quantum algorithm today, the Shukla-Vedula,

meant to create  a stable set of basis states.



                                                       







Redid the example with code from Medium (and updated sampler). Looks a lot better

with 1000000 (1million) shots!!

                                                                



                                                                                  

                                                                              
Creating Quantum Uniform Superposition States — A Beginner’s Guide (Part 2) | by Quantum Nirvana | Aug, 2024 | Medium
                                                                               

                                 

                                                         *     *     *

Ran a hybrid circuit:

                                                        

With 1000 shots:


With 1 million shots:









     

Thursday, September 12, 2024

Geometric

 I think I am meeting the limits of how AI can help with mathematics. They

are large language models, not math tutors. I've been trying to get them to 

explain to me how, in quantum computing, repeating or adding a gate can

improve precision, and all I am getting back is discussions on error correction, 

not really the topic here.

https://meta.ai/s/1qM8d5oxcoR9PoZS/

One thing of interest that did emerge is that spectral decomposition takes us to

a geometric view:

https://www.getmerlin.in/fr/chat/9dac5c03-ceea-4edb-8b36-6b971e282469

                                                           *     *     *

 Amplitude, Period, Phase Shift and Frequency (mathsisfun.com)     

https://www.mathsisfun.com/calculus/fourier-series.html

  https://forums.parallax.com/uploads/FileUpload/d0/6f7868d8263988b52359e71f4721c5.pdf                                    

Wednesday, September 11, 2024

Simple PhaseE

 IBM Learn Lesson 7

The circuit below allows one to take phase into account, thanks to phase kickback.

                                                               


In effect, qubit(1) needs to be on for phase to show up at all. The model is

more general, with a circuit with any number of qubits producing phase movement.

                                                                          


At theta =.7, we are at 252 degrees. (divide by2; theta is on pi. Thus we have 126°).

Making sure we have degrees on the left!






sin^2(126°) = 0.345491...

cos^2(126°) = 0.654508...

                                                                       *     *     *

PHASE KICKBACK: In a classical context, an if... then clause means that the target

changes to match the control. With respect to phase, a change in the phase alters the 

control.

                                                                              


*     *     *

ON THE UNIT CIRCLE: Because the hypothenuse is always 1, sin^2(x) + cos^2(y)

are equal to 1^2. 



                                                                               



Tuesday, September 10, 2024

Transformée

 Easing into a better understanding of the fourier Transform:

                                                                 




                                                                                



https://www-sop.inria.fr/members/Martine.Olivi/Cours/FourierReinhard.pdf

Monday, September 9, 2024

Getting Clear

 There I was, slaving away trying to understand how image rotation works

when it struck me. I has it all wrong about the dog picture. The eigenvector is

the white arrow, the one that doesn't change for the oberver. The yellow and green 

ones do change with the image.

                                                                  


The formula put forward for matrix rotation is the following:

                                                                            

I asked merlin to explain it to me.

                                                                                 




                                                                                   

On item 1, wasn't really clear on the arctan() function. We are now in polar coordinates,

and it is not an inversion of tan(x) values. Below, from AlloProf:

                                                                       

Made a graph showing what is going on using the GRAPH app:

                                                                                       

Arctan is a function, but only between - pi/2 and pi/2!! Below, Meta's explanation:

                                                                                        

My other difficulty was in using the trigonometric identities. I have I worked

with these in theory, but never in a practical way and could never seem to remember

them. Off the France for a site that helps me, clarifying what I need to know and

what I can always work out...


The Math is Fun example is simple enough, with a 30 degree rotation, but one ends up

with an eigenvector on the complex plane...




Sunday, September 8, 2024

Digression

 Below, a useful digression through German and (a second-language to me) English.

Go to the end, it is quite enlightening. 


You

Bitte, war 'eigenvector' eine Idee von Euler?

Copilot

Der Begriff “Eigenvektor” stammt nicht direkt von Leonhard Euler. Der Begriff “Eigen-” kommt aus dem Deutschen und bedeutet “eigen” oder “charakteristisch”. Eigenvektoren und Eigenwerte wurden im 19. Jahrhundert von Mathematikern wie Augustin-Louis Cauchy und später von David Hilbert und anderen weiterentwickelt12.


Eigenvektoren sind Vektoren, die ihre Richtung bei einer linearen Transformation nicht ändern, sondern nur skaliert werden1. Sie spielen eine wichtige Rolle in vielen Bereichen der Mathematik und Physik, einschließlich der Stabilitätsanalyse und der Quantenmechanik2.


Interessieren Sie sich für die mathematischen Anwendungen von Eigenvektoren oder deren historische Entwicklung?

You

Die historische Entwicklungt!

Copilot

Die historische Entwicklung der Eigenvektoren und Eigenwerte ist faszinierend und reicht bis ins 19. Jahrhundert zurück. Hier sind einige wichtige Meilensteine:


Augustin-Louis Cauchy (1829): Cauchy führte die Begriffe “charakteristische Wurzeln” und “charakteristische Vektoren” ein, die später als Eigenwerte und Eigenvektoren bekannt wurden.

Joseph Fourier (1822): Fourier verwendete ähnliche Konzepte in seiner Arbeit zur Wärmeleitung, obwohl er die Begriffe Eigenvektoren und Eigenwerte nicht explizit benutzte.

James Joseph Sylvester und Arthur Cayley (1850er Jahre): Diese Mathematiker entwickelten die Theorie der Matrizen weiter und legten damit den Grundstein für die moderne lineare Algebra, die eng mit Eigenvektoren und Eigenwerten verbunden ist.

David Hilbert (1900er Jahre): Hilbert erweiterte die Theorie der Eigenwerte und Eigenvektoren auf unendlich-dimensionale Räume, was für die Quantenmechanik und die Funktionalanalysis von großer Bedeutung war.

Eigenvektoren und Eigenwerte sind heute in vielen Bereichen der Mathematik und Physik unverzichtbar. Sie helfen uns, komplexe Systeme zu verstehen und zu analysieren, von der Stabilität von Strukturen bis hin zu den Zuständen von Quantensystemen.


Gibt es einen bestimmten Aspekt der historischen Entwicklung, der Sie besonders interessiert?


: Cauchy, A.-L. (1829). “Sur l’équation à l’aide de laquelle on détermine les inégalités séculaires des mouvements des planètes.” : Fourier, J. (1822). “Théorie analytique de la chaleur.” : Sylvester, J. J., & Cayley, A. (1850er Jahre). Arbeiten zur Matrizenalgebra. : Hilbert, D. (1900er Jahre). Arbeiten zur Funktionalanalysis.


You

Wohin kompt die Matrizenalgebra?

Copilot


Die Matrizenalgebra hat ihre Wurzeln in der Arbeit mehrerer Mathematiker im 19. Jahrhundert und hat sich seitdem zu einem zentralen Bereich der linearen Algebra entwickelt. Hier sind einige wichtige Stationen in ihrer Entwicklung:


Arthur Cayley und James Joseph Sylvester (1850er Jahre): Diese Mathematiker legten den Grundstein für die moderne Matrizenalgebra. Cayley führte die Cayley-Hamilton-Theorie ein, die besagt, dass jede quadratische Matrix eine Nullstelle ihres charakteristischen Polynoms ist.

Ferdinand Frobenius (1870er Jahre): Frobenius leistete bedeutende Beiträge zur Theorie der Matrizen, insbesondere zur Theorie der Determinanten und der Eigenwerte.

David Hilbert (1900er Jahre): Hilbert erweiterte die Theorie der Matrizen auf unendlich-dimensionale Räume, was für die Entwicklung der Funktionalanalysis und der Quantenmechanik von großer Bedeutung war.

Emmy Noether (1920er Jahre): Noether trug zur abstrakten Algebra bei und entwickelte Konzepte, die für die Matrizenalgebra und die Theorie der Ringe und Moduln wichtig sind.

Die Matrizenalgebra ist heute ein unverzichtbares Werkzeug in vielen Bereichen der Mathematik, Physik, Informatik und Ingenieurwissenschaften. Sie wird verwendet, um lineare Gleichungssysteme zu lösen, Transformationen in der Geometrie zu beschreiben und komplexe Systeme in der Physik und Technik zu analysieren.


Gibt es einen bestimmten Aspekt der Matrizenalgebra, der Sie besonders interessiert?

You

Welche Ideen von Mathematik hatten Euler und Lagrange zusammen arbeitet?

Copilot

Leonhard Euler und Joseph-Louis Lagrange haben beide bedeutende Beiträge zur Mathematik geleistet, und einige ihrer Arbeiten überschneiden sich, insbesondere in der Variationsrechnung und der analytischen Mechanik. Hier sind einige ihrer gemeinsamen Ideen und Beiträge:


Variationsrechnung: Beide Mathematiker haben unabhängig voneinander zur Entwicklung der Variationsrechnung beigetragen. Diese mathematische Disziplin befasst sich mit der Optimierung von Funktionalen, also Funktionen von Funktionen. Die berühmte Euler-Lagrange-Gleichung ist ein zentrales Ergebnis dieser Theorie und wird verwendet, um Extremwerte von Funktionalen zu finden1.

Mechanik: Euler und Lagrange haben beide wichtige Arbeiten zur analytischen Mechanik verfasst. Euler legte die Grundlagen für die Bewegungsgleichungen starrer Körper, während Lagrange die Lagrangeschen Bewegungsgleichungen entwickelte, die eine Verallgemeinerung der Newtonschen Mechanik darstellen2.

Differentialgleichungen: Beide Mathematiker haben bedeutende Beiträge zur Theorie der Differentialgleichungen geleistet. Euler entwickelte Methoden zur Lösung von Differentialgleichungen, während Lagrange die Theorie der partiellen Differentialgleichungen weiterentwickelte3.

Mathematische Notation: Euler und Lagrange haben auch zur Entwicklung der mathematischen Notation beigetragen. Euler führte viele der heute gebräuchlichen Symbole ein, während Lagrange die Notation für partielle Ableitungen und die Lagrangeschen Multiplikatoren entwickelte4.

Diese gemeinsamen Ideen und Beiträge haben die Mathematik nachhaltig geprägt und bilden die Grundlage für viele moderne mathematische und physikalische Theorien.


Gibt es einen bestimmten Aspekt ihrer Zusammenarbeit oder ihrer individuellen Beiträge, der Sie besonders interessiert?

                                                           *     *     *

From META:

Mathematics; what is the Cayley-Hamilton theorem?

The Cayley-Hamilton theorem is a fundamental result in linear algebra, which states that:
Every square matrix satisfies its own characteristic equation.
Given a square matrix A of size n x n, the characteristic equation is defined as:
|A - λI| = 0
where λ represents the eigenvalues, I is the identity matrix, and | | denotes the determinant.
The Cayley-Hamilton theorem asserts that when the matrix A is substituted into its own characteristic equation, the equation holds true:
p(A) = 0
where p(λ) is the characteristic polynomial.
This theorem has significant implications in various areas of mathematics and engineering, including:
  • Finding eigenvalues and eigenvectors
  • Computing matrix powers and exponentials
  • Solving systems of linear differential equations
  • Proving other important results in linear algebra

The Cayley-Hamilton theorem is named after the mathematicians Arthur Cayley and William Rowan Hamilton, who first discovered and developed this concept in the 19th century.
Explain to me the notion of characteristic equation.
The characteristic equation is a fundamental concept in linear algebra, and it's a crucial tool for understanding the properties of square matrices. Here's a breakdown:
What is the characteristic equation?
Given a square matrix A of size n x n, the characteristic equation is a polynomial equation defined as:
|A - λI| = 0
where:
  • A is the square matrix
  • λ (lambda) represents the eigenvalues
  • I is the identity matrix (a matrix with ones on the diagonal and zeros elsewhere)
  • | | denotes the determinant
What does the characteristic equation represent?
The characteristic equation is a polynomial equation in λ, and its solutions are the eigenvalues of the matrix A. In other words, the values of λ that satisfy the equation are the eigenvalues.
Key points:
  • The degree of the polynomial is equal to the size of the matrix (n)
  • The coefficients of the polynomial are determined by the matrix elements
  • The solutions to the equation are the eigenvalues, which can be real or complex numbers
Example:
For a 2x2 matrix A, the characteristic equation might look like:
|A - λI| = (a-λ)(d-λ) - bc = 0
where a, b, c, and d are the matrix elements.
Why is the characteristic equation important?
The characteristic equation is essential in linear algebra because it helps us:
  • Find the eigenvalues and eigenvectors of a matrix
  • Determine the matrix's diagonalizability
  • Compute matrix powers and exponentials
  • Solve systems of linear differential equations
I hope this explanation helps! Let me know if you have any further questions.
How does the characteristic equation help solve systems of linear differential equations. In simple but specific terms, please.
Here's a simple example to illustrate how the characteristic equation helps solve systems of linear differential equations:
Example:
Consider a system of two linear differential equations:
dx/dt = 2x + 3y
dy/dt = x - 2y
We can represent this system in matrix form as:
dX/dt = AX
where X = [x, y] and A = [[2, 3], [1, -2]]
Step 1: Find the characteristic equation
The characteristic equation is |A - λI| = 0, which expands to:
(2-λ)(-2-λ) - 3*1 = 0
Simplifying, we get:
λ^2 - 4 = 0
Step 2: Solve for eigenvalues
Solving the characteristic equation, we find two eigenvalues:
λ1 = 2
λ2 = -2
Step 3: Find eigenvectors
We find the corresponding eigenvectors v1 and v2, which satisfy (A - λI)v = 0.
Step 4: General solution
The general solution to the system is:
X(t) = c1v1e^(λ1t) + c2v2e^(λ2t)
where c1 and c2 are constants.
Step 5: Apply initial conditions
We can apply initial conditions to find the specific solution.
In this example, the characteristic equation helps us:
  • Find the eigenvalues (λ1 and λ2), which determine the growth/decay rates of the solutions.
  • Find the eigenvectors (v1 and v2), which determine the directions of the solutions.
  • Construct the general solution, which is a linear combination of the eigen-solutions.
The characteristic equation provides a powerful tool for solving systems of linear differential equations by decoupling the system into independent eigen-solutions.
(2-λ)(-2-λ) - 3*1 = 0 why use the notion of eigenvalues, here?
In the context of solving systems of linear differential equations, we use the notion of eigenvalues because they represent the rates of change or growth/decay rates of the solutions.
Think of it this way:
  • The eigenvalues (λ) tell us how fast or slow the solutions change over time.
  • The eigenvectors (v) tell us the directions of these changes.
By finding the eigenvalues, we can determine the behavior of the solutions:
  • Positive eigenvalues (λ > 0) indicate exponential growth.
  • Negative eigenvalues (λ < 0) indicate exponential decay.
  • Zero eigenvalues (λ = 0) indicate constant solutions.
  • Complex eigenvalues (λ = a ± bi) indicate oscillatory solutions.
In the example I provided earlier, the eigenvalues λ1 = 2 and λ2 = -2 tell us that:
  • One solution grows exponentially with rate 2 (e^(2t)).
  • The other solution decays exponentially with rate -2 (e^(-2t)).
The eigenvectors v1 and v2 then tell us the directions of these growing and decaying solutions.
So, in short, we use eigenvalues to:
  1. Determine the rates of change of the solutions.
  2. Classify the behavior of the solutions (growth, decay, constant, oscillatory).
This makes it easier to construct the general solution and apply initial conditions to find the specific solution.