# Search results

1. ### Using Simpson's method to integrate a complex function

By default I think quad calls qagse which does support singularities, you can also specify a series of domains to avoid them. With the right set of options you can get to most of the quadpack routines.

3. ### Trace of a subsystem of a two qubit system

You need to include the cross terms in the outer product. The density matrix for your pure state ##|\psi\rangle## is ##\rho= |\psi\rangle\langle\psi|## which includes terms like ##|00\rangle\langle 01|##
4. ### Trace of a subsystem of a two qubit system

You might want to think again about the result you got for ##\rho^{AB}##
5. ### Vector Spaces Question

For part (ii) of task 1 you want to write ## y = av_1 + bv_2 + cv_3 ## and find ##a##, ##b## and ##c##. What happens if you e.g. take the inner product of this equation with ##v_1##?
6. ### Enrollment in C programming course

As far as I can tell that is what my program does, as long as reaching a blank register causes all I/O to stop. What do you think is wrong with it?
7. ### Enrollment in C programming course

Thanks for those, they gave me a fun half hour! My solution to hte last puzzle is below for anyone interested, I think it works....
8. ### How to calculate Fourier Transform of e^-a*|t|?

Not quite. The function g(t) is even but you are integrating g(t)e^{j\omega t} which isn't even, so you need to do the other half of the integral, or notice that the negative time part is the complex conjugate of the positive time part.
9. ### Complex numbers

This is incorrect since |u|=1 it should be u= -1/2- i\sqrt{3}/2 from which the algebra follows
10. ### Complex numbers

Note that u^2=u^* and so u^2+u is real

Try adding together the new integral and the old one
12. ### Fourier transform of a lorentzian function

The Fourier transform of a Lorentzian isn't a Lorentzian (its a decaying oscillation) The Fourier transform of a Gaussian is a Gaussian, which is I guess what you mean? Do you know any theorems about the Fourier transform of a derivative to help answer your other question?
13. ### MATLAB Simple Matlab Graphics Question

If you do something like fullscreen = get(0,'ScreenSize'); set(0, 'DefaultFigurePosition', [0 -50 fullscreen(3) fullscreen(4)]) before plotting anything then it will set the default size for new figures to be maximised. Hope that helps :-)
14. ### Importance of adding the constant of integration.

Not quite, this is why the constant of integration is important. The first integration gives \frac{df}{dx}=\frac{x^4}{4}+5x+c_1 and the second integration gives f(x)=\frac{x^5}{20}+\frac{5x^2}{2}+c_1x+c_2 Which is why we need one constant of integration for each integral
15. ### Lazer but with sound?

Also don't forget the http://news.cnet.com/8301-17912_3-10267528-72.html" which creates a coherent beam of phonons
16. ### Quantum Mechanics Equation Question

But it's fine as an operator equality \frac{1}{r}\frac{\partial^2r\psi}{\partial r^2}=\frac{\partial^2\psi}{\partial r^2}+\frac{2}{r}\frac{\partial\psi}{\partial r}
17. ### MATLAB Creating Matrices in Matlab

I think glyvin wants a set of zeros inside a a vector with only ones at each end. This can be done fairly simply with something like x=zeros(n,1); x(1)=1; x(end)=1;
18. ### Simple act of taking derivatives, I suppose

I agree with all of that, and am now stumped, sorry :frown: If you work it out, let me know!
19. ### Simple act of taking derivatives, I suppose

The derivative of a delta function has the property \int_{-\infty}^\infty\delta'(t)f(t)dt=-f'(0) In your equation you should have a term like \delta'(\tau)(e^{i\omega\tau}+e^{-i\omega\tau}) which at \tau=0 has a derivative which goes away so this term gives no contribution. Hope that...
20. ### Simple act of taking derivatives, I suppose

The sin and cos terms are multiplied by delta functions, right? So you can take them to be at t=t' and so they give the required values.
21. ### Simple act of taking derivatives, I suppose

The derivative of \Theta(t) is \delta(t). You can then use this result, along with the fact that the second derivative of \Theta(t) is peaked at t=0 (so that these terms cancel) to find \partial^2_t G and substitute to find the answer. If you want any more details please show what you have...
22. ### MATLAB Matlab floating point

Instead of using the complicated function above, you could just do something like abs(V3c-V3(2))<epsilon where you set epsilon as the tolerance you want to keep. This then returns a logical with ones where the two things were equal. Hope that helps :smile:
23. ### MATLAB Matlab : reverse FFT

Yes, try reading the documentation for the function ifft
24. ### Derivative of sin^2x

The fact that two functions cross at a particular point does not mean that their derivative is the same. You could do the same thing with much simpler functions eg f(x)=x, g(x)=2x these cross at x=0 but they obviously don't have the same gradient.
25. ### Probability of finding a particle in a 1D Box

Your answer cannot be a function of x, since you are integrating over x. Try substituting your expression for \Psi(x) from your first post before you integrate.
26. ### Doctor or Physicist

If you are in the UK then the lack of a maths A-level will be a problem getting accepted onto physics courses...
27. ### MATLAB Matlab (size)

size(A,n) returns the length along the nth dimension of the matrix A. This means that for a 2x2 matrix (i.e a 2D matrix) for n>2 we have that size(A,n)=1 but for n=1,2 size(A,n)=2 since it is only in the first two dimensions that the matrix has any entries.
28. ### MATLAB Matlab question

Or, instead of writing "for m=1:2", write "for index=1:2" and this should take care of everything
29. ### Bessel Functions

The Bessel function can be written as a generalised power series: J_m(x) = \sum_{n=0}^\infty \frac{(-1)^n}{ \Gamma(n+1) \Gamma(n+m+1)} ( \frac{x}{2})^{2n+m} Using this show that: \sqrt{\frac{ \pi x}{2}} J_{1/2}(x)=\sin{x} where...