I'm trying to compute the 2nd order correction to the energy spectrum of a 1D quantum harmonic oscillator when a perturbation of the form $\gamma\,\hat{x}^k$ (with $\gamma\ll1$) is added to the Hamiltonian. This is $$E_n^{(2)}\equiv\langle \psi_n^{(0)} | \,\gamma\hat{x}^k\, | \psi_n^{(1)} \rangle = \sum_{n'\neq n} \frac{{\left|\, \langle \psi_{n'}^{(0)} | \,\gamma\hat{x}^k\, | \psi_n^{(0)} \rangle\,\right|}^{\,2}}{E_n^{(0)}-E_{n'}^{(0)}} = \left(\frac{\hbar}{2m\omega}\right)^k \sum_{n'\neq n} \frac{{ \gamma^2 \left|\, \langle n' | \,(\hat{a}^\dagger+\hat{a})^k\, | n\rangle \,\right|}^{\,2}}{\hbar\omega\,(n-n')}\;.$$ where $\,\hat{x}=\sqrt{\frac{\hbar}{2mw}}\,(\,\hat{a}^\dagger + \hat{a}\,)\;$, $\;E_n^{(0)}=\hbar\omega(n+1/2)\;$ and $\;| \psi_n^{(0)} \rangle\equiv|n\rangle$.  Now, the question is how to compute this term: $$\alpha_{n'n}\equiv \langle n' | \,(\hat{a}^\dagger+\hat{a})^k\, | n\rangle =\left(\frac{\langle \,0\,|\hat{a}^{n'} (\hat{a}^\dagger+\hat{a})^k {\hat{a}^\dagger}^n\, |\,0\, \rangle}{\sqrt{n'\,!\; n!}}\right)\;.$$ I think it can be &quot;easily&quot; obtained uaing Wick's theorem but I'm not sure about how to apply it. I'm struggling with the part of counting all of the possible ways to fully-contract the operators for any $k$. Do you know any shortcut or some hint to help me compute it?. In fact, is it even manageable?.
I'm trying to evaluate $(\hat{a}+\hat{a}^\dagger)^k|n\rangle$ Where $\hat{a}$ and $\hat{a}^\dagger$ are ladder operators and $|n\rangle$ the $n$th Fock state. For this, I separated the problem in three parts: $k&lt;n$, $k=n$ and $k&gt;n$. In this part I'm a bit confused: Is it possible to evaluate such operations? Some tips on how to start would be really great.
What is glue stretching? I had a question about dynamic vspaces () and there was a hint I should use a stretchable glue. Searching with Google didn't give me a helpful answer.  I would be glad, if someone can explain it and give me a simple example to understand how it works. I have read the explanation for this in several textbooks, but I am struggling to understand it via Archimedes' principle. If someone can clarify with a diagram or something so I can understand or a clear equation explanation that would be great. Protons and Neutrons Overshoot Actual Mass? When I add up the mass of 6 protons and 6 neutrons in amu, I get a mass that is greater than the mass of carbon. I thought that it should be the other way around, because I have not including binding energy when I add up the mass of the protons and neutrons.  Proton: 1.007276466812 u  Neutron: 1.00866491600 u  6(1.007276466812)+6(1.00866491600)=12.099  Carbon: 12 u  Why is this so? Make IN clause behave like AND clause I've asked the same question on , but got no answer, so that's why I'm asking it here (I've read that simple sql questions should be asked at SO, but I have no choice).  Suppose I have 3 tables: posts, post_categories and categories. I'm implementing some kind of page with filters where I can filter posts by categories. User can select multiple categories. When he selects more than one, they should be summed. I can't get it working. What I have now is simple IN() SQL clause:  SELECT posts.id, post_categories.category_id FROM posts  JOIN post_categories ON posts.id = post_categories.post_id  WHERE post_categories.category_id IN (1,2,3) LIMIT 10;   But it is not matching all ids, it is OR and I need AND. What I need here is to find all posts that have categories with id=1 AND id=2 AND id=3, but instead this query returns posts that have at least one category from the IN() list. What are the automorphisms acting on $Q\sqrt[3]{2}$ that fixes Q? Why is vote time missing in the SE data dump and SEDE? How to call the method correctly in Preference.OnPreferenceChangeListener() Do photons have acceleration? Photons travel at the fastest speed in our universe, the speed of light.  Do photons have acceleration? 14.04 LTS No Dash / Launcher after update through Software Updater What is the meaning of “runneth” in ? Android does not download any files from untrusted CA certificate site So I am currently making a minecraft custom map (for 1.9). I want to make the player "say" something using /tellraw commands. I did figure out how to make the player name come up using /say commands, but still have no idea how to do it using the /tellraw command.  How do I do that? I have purchased a rather large bag of long-grain white rice (25 lbs.) and need to know the best way for storing it long-term. This rice will be used as both a food-storage food source and as my everyday source of rice for cooking, so the storage solution should (hopefully) be resealable, rather than once-it's-open-it's-open. I eat rice maybe three times a month, so it isn't really "everyday" but it will be my go-to when I have it. ggmap: create circle symbol where radius represents distance (miles or km) Don't you think people need to know what they did wrong exactly so they can fix it and get unbanned from asking questions or posting answers? How to get text from an element , when getText fails I have the following element element(by.css(&quot;span[aria-label='Picker ID, TESTUSER']&quot;)  I want to assure the text on this filed is TESTUSER, so I tried:  expect(element(by.css(&quot;span[aria-label='Picker ID, TESTUSER']&quot;)).getAttribute('value')).toEqual('TESTUSER');  then I got the error: Expected null to equal 'TESTUSER' So I tried: element(by.css(&quot;span[aria-label='Picker ID, TESTUSER']&quot;)).getText().then(function (value) {         console.log(value);       })  And I got this error: Expected '' to be 'TESTUSER'.  How to get the value of this field and expect it is TESTUSER? How do I autohide the top panel in Unity? When windows are not maximized, the top panel is basically wasted space for me in Unity.  Is there a way to make it autohide? i.e. make it appear on mouse over. Including Interaction Terms in Random Forest Suppose we have a response Y and predictors X1,....,Xn. If we were to try to fit Y via a linear model of X1,....,Xn, and it just so happened that the true relationship between Y and X1,...,Xn wasn't linear, we might be able to fix the model by transforming the X's somehow and then fitting the model. Moreover, if it just so happened that the X1,...,XN didn't affect y independent of the other features, we also might be able to improve the model by including interaction terms, x1*x3 or x1*x4*x7 or something of the like. So in the linear case, interaction terms might bring value by fixing non-linearity or independence violations between the response and the features.  However, Random Forests don't really make these assumptions. Is including interaction terms important when fitting a Random Forest? Or will just including the individual terms and choosing appropriate parameters allow Random Forests to capture these relationships? Escape Key in the Chat In Random forest algorithm, Breiman (author) constructs similarity matrix as follows:   Send all learning examples down each tree in the forest If two examples land in the same leaf increment corresponding element in similarity matrix by 1 Normalize the matrix with number of trees   He says:     The proximities between cases n and k form a matrix {prox(n,k)}. From their definition, it is easy to show that this matrix is symmetric, positive definite and bounded above by 1, with the diagonal elements equal to 1. It follows that the values 1-prox(n,k) are squared distances in a Euclidean space of dimension not greater than the number of cases.    In his implementation, he uses sqrt(1-prox), where prox is a similarity matrix, to convert it to distance matrix. I guess it has something to do with the "sqaured distances in a Euclidean space"-quoted above.  Can somebody shine a little light on why it follows that 1-prox are squared distances in a Euclidean space and why he uses squared root to get distance matrix?