The best articles by Ciro Santilli Updated +Created
These are the best articles ever authored by Ciro Santilli, most of them in the format of Stack Overflow answers.
Ciro posts update about new articles on his Twitter accounts.
A chronological list of all articles is also kept at: Section "Updates".
Some random generally less technical in-tree essays will be present at: Section "Essays by Ciro Santilli".
Deletionism on Wikipedia Updated +Created
Some examples by Ciro Santilli follow.
Of the tutorial-subjectivity type:
Notability constraints, which are are way too strict:
  • even information about important companies can be disputed. E.g. once Ciro Santilli tried to create a page for PsiQuantum, a startup with $650m in funding, and there was a deletion proposal because it did not contain verifiable sources not linked directly to information provided by the company itself: en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/PsiQuantum Although this argument is correct, it is also true about 90% of everything that is on Wikipedia about any company. Where else can you get any information about a B2B company? Their clients are not going to say anything. Lawsuits and scandals are kind of the only possible source... In that case, the page was deleted with 2 votes against vs 3 votes for deletion.
    should we delete this extremely likely useful/correct content or not according to this extremely complex system of guidelines"
    is very similar to Stack Exchange's own Stack Overflow content deletion issues. Ain't Nobody Got Time For That. "Ain't Nobody Got Time for That" actually has a Wiki page: en.wikipedia.org/wiki/Ain%27t_Nobody_Got_Time_for_That. That's notable. Unlike a $600M+ company of course.
    In December 2023 the page was re-created, and seemed to stick: en.wikipedia.org/wiki/Talk:PsiQuantum#Secondary_sources It's just a random going back and forth. Author Ctjk has an interesting background:
    I am a legal official at a major government antitrust agency. The only plausible connection is we regulate tech firms
There are even a Wikis that were created to remove notability constraints: Wiki without notability requirements.
For these reasons reason why Ciro basically only contributes images to Wikipedia: because they are either all in or all out, and you can determine which one of them it is. And this allows images to be more attributable, so people can actually see that it was Ciro that created a given amazing image, thus overcoming Wikipedia's lack of reputation system a little bit as well.
Wikipedia is perfect for things like biographies, geography, or history, which have a much more defined and subjective expository order. But when it comes to "tutorials of how to actually do stuff", which is what mathematics and physics are basically about, Wikipedia has a very hard time to go beyond dry definitions which are only useful for people who already half know the stuff. But to learn from zero, newbies need tutorials with intuition and examples.
Bibliography:
Discrete Fourier transform Updated +Created
Input: a sequence of complex numbers .
Output: another sequence of complex numbers such that:
Intuitively, this means that we are braking up the complex signal into sinusoidal frequencies:
  • : is kind of magic and ends up being a constant added to the signal because
  • : sinusoidal that completes one cycle over the signal. The larger the , the larger the resolution of that sinusoidal. But it completes one cycle regardless.
  • : sinusoidal that completes two cycles over the signal
  • ...
  • : sinusoidal that completes cycles over the signal
and is the amplitude of each sine.
We use Zero-based numbering in our definitions because it just makes every formula simpler.
Motivation: similar to the Fourier transform:
  • compression: a sine would use N points in the time domain, but in the frequency domain just one, so we can throw the rest away. A sum of two sines, only two. So if your signal has periodicity, in general you can compress it with the transform
  • noise removal: many systems add noise only at certain frequencies, which are hopefully different from the main frequencies of the actual signal. By doing the transform, we can remove those frequencies to attain a better signal-to-noise
In particular, the discrete Fourier transform is used in signal processing after a analog-to-digital converter. Digital signal processing historically likely grew more and more over analog processing as digital processors got faster and faster as it gives more flexibility in algorithm design.
Sample software implementations:
Figure 1.
DFT of with 25 points
. This is a simple example of a discrete Fourier transform for a real input signal. It illustrates how the DFT takes N complex numbers as input, and produces N complex numbers as output. It also illustrates how the discrete Fourier transform of a real signal is symmetric around the center point.
Fast Fourier transform Updated +Created
An efficient algorithm to calculate the discrete Fourier transform.
@cirosantilli/_file/numpy/numpy/fft.py Updated +Created
Output:
sin(t)
fft
real 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
imag 0 -10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10
rfft
real 0 0 0 0 0 0 0 0 0 0 0
imag 0 -10 0 0 0 0 0 0 0 0 0

sin(t) + sin(4t)
fft
real 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
imag 0 -10 0 0 -10 0 0 0 0 0 0 0 0 0 0 0 10 0 0 10
rfft
real 0 0 0 0 0 0 0 0 0 0 0
imag 0 -10 0 0 -10 0 0 0 0 0 0
With our understanding of the discrete Fourier transform we see clearly that:
  • the signal is being decomposed into sinusoidal components
  • because we are doing the Discrete Fourier transform of a real signal, for the fft, so there is redundancy in the. We also understand that rfft simply cuts off and only keeps half of the coefficients
@cirosantilli/_file/qiskit/qiskit/qft.py Updated +Created
This is an example of the qiskit.circuit.library.QFT implementation of the Quantum Fourier transform function which is documented at: docs.quantum.ibm.com/api/qiskit/0.44/qiskit.circuit.library.QFT
Output:
init: [1, 0, 0, 0, 0, 0, 0, 0]
qc
     ┌──────────────────────────────┐┌──────┐
q_0: ┤0                             ├┤0     ├
     │                              ││      │
q_1: ┤1 Initialize(1,0,0,0,0,0,0,0) ├┤1 QFT ├
     │                              ││      │
q_2: ┤2                             ├┤2     ├
     └──────────────────────────────┘└──────┘
transpiled qc
     ┌──────────────────────────────┐                                     ┌───┐   
q_0: ┤0                             ├────────────────────■────────■───────┤ H ├─X─
     │                              │              ┌───┐ │        │P(π/2) └───┘ │ 
q_1: ┤1 Initialize(1,0,0,0,0,0,0,0) ├──────■───────┤ H ├─┼────────■─────────────┼─
     │                              │┌───┐ │P(π/2) └───┘ │P(π/4)                │ 
q_2: ┤2                             ├┤ H ├─■─────────────■──────────────────────X─
     └──────────────────────────────┘└───┘
Statevector([0.35355339+0.j, 0.35355339+0.j, 0.35355339+0.j,
             0.35355339+0.j, 0.35355339+0.j, 0.35355339+0.j,
             0.35355339+0.j, 0.35355339+0.j],
            dims=(2, 2, 2))

init: [0.0, 0.35355339059327373, 0.5, 0.3535533905932738, 6.123233995736766e-17, -0.35355339059327373, -0.5, -0.35355339059327384]
Statevector([ 7.71600526e-17+5.22650714e-17j,
              1.86749130e-16+7.07106781e-01j,
             -6.10667421e-18+6.10667421e-18j,
              1.13711443e-16-1.11022302e-16j,
              2.16489014e-17-8.96726857e-18j,
             -5.68557215e-17-1.11022302e-16j,
             -6.10667421e-18-4.94044770e-17j,
             -3.30200457e-16-7.07106781e-01j],
            dims=(2, 2, 2))
So this also serves as a more interesting example of quantum compilation, mapping the QFT gate to Qiskit Aer primitives.
If we don't transpile in this example, then running blows up with:
qiskit_aer.aererror.AerError: 'unknown instruction: QFT'
The second input is:
and the output of that approximately:
[0, 1j/sqrt(2), 0, 0, 0, 0, 0, 1j/sqrt(2)]
which can be defined simply as the normalized DFT of the input quantum state vector.