Skip to content

Instantly share code, notes, and snippets.

View Nikolaj-K's full-sized avatar
💭
I'm combinating Why's.

Nikolaj Kuntner Nikolaj-K

💭
I'm combinating Why's.
  • DLR Germany, IST Austria, Infineon, ...
  • Vienna
View GitHub Profile
@Nikolaj-K
Nikolaj-K / paili_matrices.txt
Created December 16, 2020 20:39
su(2) basis vs. Pauli matrices vs. quaternions
Text discussed in the video
https://youtu.be/uso0RZvgiWY
===== su(2) basis vs. Pauli matrices vs. quaternions =====
==== 2x2 Hermitian matrices ====
Looking at complex matrices in ${\mathbb M}({\mathbb C})_{2\times 2}$.
Conjugate transpose function:
$\begin{pmatrix} \alpha & \beta \\ \gamma & \delta \end{pmatrix}^*:=\begin{pmatrix} \bar\alpha & \bar\gamma \\ \bar\beta & \bar\delta \end{pmatrix}$
@Nikolaj-K
Nikolaj-K / su2_actions.txt
Created December 13, 2020 23:08
SU(2) actions for spherical coordinates
This is the script used in the video
https://youtu.be/DkgpE2MVDrs
===== SU(2) actions for spherical coordinates =====
==== Convention ====
$\bullet$ Righthanded rotations, a.k.a. counterclockwise in plane (as supposed to lefthanded)
(like standard complex number multiplication in the plane of rotation, with the axis pointing towards you).
$\bullet$ Extrinsic rotation (as opposed to intrinsic):
@Nikolaj-K
Nikolaj-K / runge_kutta.py
Created December 4, 2020 23:27
Runge Kutta
import matplotlib.pyplot as plt
import numpy as np
def weighted_mean(weights, values):
assert len(weights) == len(values)
terms = (w * v for w, v in zip(weights, values))
return sum(terms) / sum(weights)
@Nikolaj-K
Nikolaj-K / spherical_pendulum.py
Last active July 11, 2021 12:29
Animation of the spherical pendulum
"""
Run via
python /Users/amoogle/Documents/Pages/pages_video/spherical_pendulum_sim.py
I have explained the animation tool in
https://youtu.be/rQwnOZFuYsU
"""
import math
import matplotlib
@Nikolaj-K
Nikolaj-K / accountability.json
Last active December 17, 2020 19:07
Participation accountability dict
{
"201201": {
"1": [
"Toma Dup",
"Johni Johni"
],
"2": [
"Toma Dup"
]
},
@Nikolaj-K
Nikolaj-K / stirner.txt
Created November 29, 2020 22:01
Stirner reading
So this is 170 years ago when Germany isn’t really Germany, you have Hegel (and e.g. Schopenhauer) lecturing about his dialectical logic and view of history, in Berlin, and there emerges the group of young Hegelians arguing with each other. Completely contrary to Hegels view on the state, but very much in line with his logic and methods, they (Marx, Feuerbach, Stirner, etc.) all start writing books (and being censored). In particular Feuerbach writing the The Essence of Christianity, in which - after Nietzsches death of god at the same time - he makes the ideal human get the centerstage. A proper humanism. Stirner writes his treaty of the self and what it means to own in this context (“The Unique one and his Property”.) The chapter structure parodies Feuerbach and the first dozen of pages of the book parodies Hegels perspective on the world. Stirner criticises that Feuerbach makes “the good human“ a new abstraction that merely replaces the perfect god Feuerbach wants to part with in his ideology. He takes tha
@Nikolaj-K
Nikolaj-K / SO2Q.txt
Last active November 25, 2020 20:14
SO(2, ℚ) vs. Pythagoras
This is the text for the video
https://youtu.be/pYBLStI9VlE
=== SO(2, Q) ===
Given any two ${\mathrm e}^{ia},{\mathrm e}^{ib}\in {\sf{U}}(1)$, their product ${\mathrm e}^{ia}\cdot{\mathrm e}^{ib}$ is again in ${\sf{U}}(1)$.
Various subgroups embed into ${\sf{U}}(1)$.
The upper left point in that Wikipedia picture
https://en.wikipedia.org/wiki/Template:Group_theory_sidebar#/media/File:Cyclic_group.svg
@Nikolaj-K
Nikolaj-K / yield_cauchy_sequences.py
Last active November 11, 2020 21:26
Streaming Cauchy sequences in pi
"""
Code for the video:
https://youtu.be/MUbZ9XqWsuc
https://en.wikipedia.org/wiki/List_of_formulae_involving_%CF%80
"""
import math
import time
@Nikolaj-K
Nikolaj-K / formal_power_series.py
Last active November 4, 2020 19:48
Infinite lazy lists for power series in Python: yield
"""
Scrpt for the video here:
https://youtu.be/Gzz5_BbvGos
References
See also: https://rosettacode.org/wiki/Formal_power_series#Python
https://en.wikipedia.org/wiki/Formal_power_series
https://en.wikipedia.org/wiki/Lazy_evaluation
https://en.wikipedia.org/wiki/Computable_analysis
@Nikolaj-K
Nikolaj-K / bruteforcing_semirings.py
Created October 21, 2020 18:20
Finite commutative semirings
"""
This is the script discussed in the video:
https://youtu.be/dmSK0siN7c4
"""
N = 5
"""
Compute the commutative semirings of size N > 1 that are