@Blue The trick is to figure out what the general question is, rather than "What's wrong with this code?".
Then search for the general question before posting.
Your general question is likely about either the difference between scan.next() and scan.nextLine() in the handling of line endings, or about how they interact with one another.
@dmckee I'm framing the question like: "Why scan.nextLine() seems to neglect the string input while scan.next() works fine?"(Followed by my example code) Does that sound okay?
I was solving 30 Days Of Code: Day 1 Challenge on HackerRank.
Here's my code:
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
int i = 4;
d...
Given that a vector $|\psi \rangle$ is not in the span of the basis vectors $|p \rangle$ which diagonalize a density operator given by $\rho = \sum \lambda_p | p \rangle \langle p |$ with corresponding eigenvalues $\lambda_p$, it apparently follows that $\langle \psi | \rho | \psi \rangle = 0$.
How do we show this? I thought that maybe we can use that $\langle \psi | \rho | \psi \rangle = \sum_p \lambda_p|\langle \psi| p \rangle|^2 = 0$ and if $\psi$ is not in the span $|p \rangle$ then $\langle \psi|p \rangle =0$ for all $p$ but I'm not sure this is true, that would imply that any vector not in the span of the $|p \rangle$s would be orthogonal to the space spanned by the $|p \rangle s$ .
@JohnJack Then it's a) not a basis and b) if you defined the $\lvert p\rangle$ to span the space on which $\rho$ does not act as zero, I do not see what there is left to show.
@0celo7 Yes I know, I'm just trying to confirm my original query as to why $\langle \psi|\rho | \psi \rangle = 0$. But I understand now, any $|\psi \rangle$ outside will be written in the span of eigenstates of $\rho$ (those which correspond to zero eigenvalues) henceforth the result follows from that...
@Justwinbaby It's inappropriate to imply that someone (JR) did something (get Ron suspended) which you have no way of knowing that they actually did. Kind of a general principle, but especially when it comes to discussing suspensions.
That reads, to me: when it comes to discussing suspensions, don't.
A sequence of accidents made me arrive here. Why to exist on meta if you can use the time to learning physics? So, I am rarely on meta. Well, this question made me produce my first comment on meta, which made me produce my first question ever on meta. Yay!
Anyway.. The question linked above seem...
I'm a mathematics student with not much background in physics. I'm interested in learning about the path integral formulation of quantum mechanics. Can anyone suggest me some books on this topic with minimum prerequisite in physics?
I think this question has its place here because I am sure some of you are "self-taught experts" and can guide me a little through this process.
Considering that :
I don't have any physics scholar background at all.
I have a little math background but nothing too complicated like calculus
I am...
@heather either $a$ is a factorial, and if you know that then you likely know what it's a factorial of
finding $c-x$ is only expensive if $a$ is huge, and then the Stirling approximation will give you a restricted set of integers from which you can check to see if they factorialize to $a$
or else $a$ is not a factorial, and then you're inverting the gamma function
This is an analysis question I remember thinking about in high school. Reading some of the other topics here reminded me of this, and I'd like to hear other people's solutions to this.
We have the gamma function, which has a fairly elementary form as we all know,
$\Gamma(z) = \int_0^\infty e^{-...