Is helium actually multi-configurational?

This post is inspired by a paper by Ali Alavi and a talk by Frank Neese at ICQC 2023. The goal of the work by Frank Neese and Ali Alavi is to be able to describe a wave function with...

Benchmark tracking certainty of funds

In the decision of which funds to invest in, an important parameter is how well the fund can track the benchmark index. It is to be expected that the variance of how well a specific fund can track an index...

Bayesian inference of Gaussian parameters

In a previous post Bayesian inference was used to infer the parameter of a binomial distribution. The binomial distribution can be used to describe events with discrete outcomes. However, a lot of interesting probabilistic events are continuous. One of the...

Variational quantum eigensolver unitary coupled cluster ansatz

In a previous post the Jordan-Wigner representation of the molecular Hamiltonian for the hydrogen molecule was constructed. This Hamiltonian was solved by explicit diagonalization. The method of explicit diagonalization quickly becomes computationally impossible when the dimension of the Hamiltonian grows,...

Jordan-Wigner Hamiltonian for H2

The first step of using quantum computers to perform quantum chemical simulations is to translate the fermionic Hamiltonian to a qubit Hamiltonian (represented by Pauli operators). The fermionic Hamiltonian in spin basis is: \[H = \sum_{pq}h_{pq}a^\dagger_p a_q + \frac{1}{2}\sum_{pqrs}g_{pqrs}a^\dagger_p a^\dagger_q...

Constructing FCI for H2 lazily

The hydrogen molecule in a minimal basis (STO-3G as an example) will have a full CI Hamiltonian that is only four by four (using the determinants with \(M_S=0\)). The four determinants in second quantization language are \(\left|1100\right>\), \(\left|1001\right>\), \(\left|0110\right>\), and,...

Using geomeTRIC with Hellmann-Feynman forces

In a previous post the Hellmann-Feynman forces were calculated using PySCF, and used gradient descent to optimize the geometry of the molecule. Geometry optimization is however a surprisingly hard problem, and writing algorithms from scratch might result in poorly behaved...

Hellmann-Feynman forces with PySCF

The Hellmann-Feynman theorem states that: \[\frac{\mathrm{d}E}{\mathrm{d\lambda}} = \left<\psi\left|\frac{\mathrm{d}\hat{H}}{\mathrm{d}\lambda}\right|\psi\right>\] It should be noted that this theorem does not hold for a finite atom-centered basis, and one might want to account for Pulay forces. For the molecular Hamiltonian: \[\hat{H} = -\frac{1}{2}\sum_i\nabla_i^2 -...

Jordan-Wigner representation

Current quantum computers work with unitary gates. In order to represent operators relevant for quantum chemistry on a quantum computer, unitary operators are thus needed. The condition for a unitary operator is: \[UU^\dagger = I\] It can easily be checked...

Second quantization in matrix formulation

Coming from a theoretical chemistry background, I have mostly learned second quantization from Molecular Electronic-Structure Theory. From here the algebra is taught with the ON vector, \(\left|10\right>\) denoting the first orbital being occupied and the second orbital being unoccupied. In...

five five-letter words with twenty-five unique letters?

The content creator Matt Parker made a YouTube video titled Can you find: five five-letter words with twenty-five unique letters?. The essence of the question at hand is how many combinations of five five-letter words exist such that all twenty-five...

UK Premium Bonds, 'Expected' Return

In the United Kingdom investors can invest in a class of bonds known as premium bonds. Premium bonds do not have a fixed coupon rate, but yield is instead distributed via a lottery. The prizes distributed as of May 2022...

House prices and interest rates

Over the past 25 years the house prices have appreciated by a factor of ~3.5. But what drivers have been the primary for this price appreciation, and can this continue going forward? The primary drivers for appreciation of house prices...

Estimating drop chances with Bayesian statistics

In many games, different items or events have an associated chance to appear. Often these chances are unknown to the players. In this post, we will try to estimate the chance of getting a Mysterious Stranger in Hearthstone Mercenaries from...

Perfect Amalgadon, exact chances

In Hearthstone battlegrounds as of patch 18.6.1 the Amalgadon card has the following effect: Battlecry: For each different minion type you have among other minions, Adapt randomly. When playing Amalgadon the number of adapts will be in the range between...

Overlap between Danish investment funds

Given the selection of Danish investment funds from Sparindex and Danske Invest, it can be difficult to see how different the funds are. As a measure of similarity, one can calculate the overlap between two funds. The overlap between fund...

Model for the price of Danish investment funds

In Denmark, all ETFs are taxed yearly by unrealized returns. On the other hand, some Danish investment funds are taxed by realized gain, if they fulfill some criteria of paid out dividends. The dividend paid out will be: earned dividends...

Brokerage vs. opportunity cost

Many brokers (at least in Denmark), have a pricing model of \(q\%\) of the trading amount or a minimum of \(p\) euro. Given a fixed amount to invest every month, we might think it is best to accumulate the cash...

Investing an SU loan

During education it is possible to take an SU loan (Danish student loan). If one takes an SU loan solely for investing, what can one then expect after the loan has been repaid? This will be investigated in the following...

Index and ongoing charges for Nordnet's monthly savings and SKAT's positive list

Remember to check the web-scraped information yourself to make sure it is correct. Given lists such as SKAT’s positive list and Nordnet’s monthly savings, it can be hard to get an overview of costs and which indices the different ETFs...

Estimate of CAGR after tax and ongoing charges

Given an idea of how much one’s strategy returns per year on average, it can be useful to estimate what this corresponds to after tax and ongoing charges (ÅOP). This estimate differs between mark-to-market taxation and taxation on realisation. Derivation...

ASK vs. taxation on realisation

The equity savings account (ASK) has a low tax rate of 17%, but is taxed mark-to-market. In principle, taxation on realisation with share tax of 27%/42% could give a higher return over a long period due to compound interest. Here...

Upper limit for tax optimisation

For a portfolio taxed on realisation, the portfolio value after \(y\) years is given by: \[D_{y}\left(k,\left\{ a_{i}\right\} \right)=k\cdot\prod_{i=1}^{y}\left(1+a_{i}\right)-s_{p,q,g,y}\left(k\cdot\prod_{i=1}^{y}\left(1+a_{i}\right)-k,\left\{ r_{i}\right\} \right)\] \(k\) is the starting capital, \(\left\{ a_{i}\right\}\) is a set of yearly returns and \(y\) is the number of years....

Danish investment funds vs. ETFs: taxation

Some Danish investment funds are taxed on realisation, provided they meet certain criteria regarding the payout of dividends. This comparison of investment funds taxed on realisation and ETFs uses prices from Saxo. For the investment fund, an ongoing charge (ÅOP)...

Unit for one-photon absorption spectrum

Following the source: A. Rizzo, S. Coriani, and K. Ruud, Computational Strategies for Spectroscopy. From Small Molecules to Nano Systems, edited by V. Barone (John Wiley and Sons, 2012) Chap. 2, pp.77–135. It is given in Eq. (2.35) that: \[\varepsilon(\omega)...

Constructing molecular integrals with derivative on the r_inv operator by partial integration

In quantum chemistry integrals of the following form are sometimes needed: \[F_a = \left<\phi_i\left|\nabla^a r^{-1}\right|\phi_j\right>\] But these integrals are often not directly available. What instead is available is integrals of the form: \[f_a = \left<\nabla^a\phi_i\left|r^{-1}\right|\phi_j\right>\] \[f_{a,b} = \left<\nabla^a\phi_i\left|r^{-1}\right|\nabla^b\phi_j\right>\] Let us...

Multipole fit with Lagrangian multipliers

Consider the electrostatic potential due to multipoles placed at the positions of atoms: \[E_{i}=\sum_{j}^{atom}\sum_{n}^{multipole}\frac{\left(-1\right)^{n}}{n!}T_{ij}^{(n)}m_{j}^{(n)}\] If the quantum mechanical electrostatic potential is to be minimized, a cost function can be written in the form: \[z=\sum_{i}^{point}\left(V_{i,\mathrm{QM}}-E_{i}\right)^{2}+\sum_{l}^{constraints}\lambda_{l}g_{l}\] Expanding the square: \[z=\sum_{i}^{point}\left(V_{i,\mathrm{QM}}^{2}+E_{i}^{2}-2E_{i}V_{i,\mathrm{QM}}\right)+\sum_{l}^{constraints}\lambda_{l}g_{l}\] It is...

Second order partial derivative for multivariate function, derivation

Consider a function: \[f\left(x_{1}\left(\lambda_{1},\lambda_{2},..,\lambda_{M}\right),x_{2}\left(\lambda_{1},\lambda_{2},..,\lambda_{M}\right),..,x_{N}\left(\lambda_{1},\lambda_{2},..,\lambda_{M}\right)\right)\] The first partial derivative is given as: \[\frac{\partial}{\partial\lambda_{i}}f\left(x_{1},x_{2},..,x_{N}\right)=\frac{\partial f}{\partial x_{1}}\frac{\partial x_{1}}{\partial\lambda_{i}}+\frac{\partial f}{\partial x_{2}}\frac{\partial x_{2}}{\partial\lambda_{i}}+...+\frac{\partial f}{\partial x_{N}}\frac{\partial x_{N}}{\partial\lambda_{i}}\] The above equation can be formulated as: \[\frac{\partial}{\partial\lambda_{i}}f\left(x_{1},x_{2},..,x_{N}\right)=\sum_{k}^{N}\frac{\partial f}{\partial x_{k}}\frac{\partial x_{k}}{\partial\lambda_{i}}\] Now consider the second derivative: \[\frac{\partial^{2}}{\partial\lambda_{j}\partial\lambda_{i}}f\left(x_{1},x_{2},..,x_{N}\right)=\frac{\partial}{\partial\lambda_{j}}\left(\frac{\partial f}{\partial x_{1}}\frac{\partial...