Tag Info

New answers tagged

8

The definition of the scalar product in your question assumes that all your kets are orthogonal unit vectors. In that case, the most natural approach would be to use the built-in Bra and Ket as follows: Ket /: Dot[Bra[x__], Ket[y__]] := Times @@ MapThread[KroneckerDelta, {{x}, {y}}] BraKet[x_, y_] := Bra[x].Ket[y] Bra[2, 4].Ket[2, 4] (* ==> 1 *) ...


4

The relevant topics here are "Operators without built-in meanings" and solving your problem is a matter of assigning meanings to them. Important to note here: the left and right angle brackets are typed as :esc: < :esc: and :esc: > :esc: and are not the same as the Greater and Less signs, but for brevity I will be typing them simply as < and > ...


1

Presumably you want Nest or NestList with or without Composition n = 3; (* increase n to 10 for your example *) To display each step clist1 = NestList[{g[#[[2]]], f[g[#[[2]]]]} &, {0, 1}, n] // Flatten[#, 1] & // Drop[#, 2] & {g[1], f[g[1]], g[f[g[1]]], f[g[f[g[1]]]], g[f[g[f[g[1]]]]], f[g[f[g[f[g[1]]]]]]} For just end result use ...


2

As @kattern pointed out, MatrixForm will pretty print your lists to look like matrices. {{0}, {1}, {0}, {-1}} // MatrixForm A word of caution, however: MatrixForm can get in the way of your calculations if you are not careful. See this question and the related answers: Why does MatrixForm affect calculations?. For instance, you could get bitten by ...


7

Add this to your notebook or init file $PrePrint = If[MatrixQ[#], MatrixForm[#], #] &; Then all matrices will automatically display as MatrixForm and If you want to format lists as column vectors also, try $PrePrint = Which[MatrixQ[#], MatrixForm[#], VectorQ[#], ColumnForm[#], True, #] &; Now also


1

Here I present my first working solution that uses the components of NDSolv. (I hope posting a new answer is the right way to do this.) The goal is to use the "ion drive" for awhile, and then "coast" from where that leaves us up to the vicinity of the Moon. This first block initializes some constants: G = 6.672*10^-11; M = 5.97219*10^24;(*Mass of Earth*) ...


2

Maybe tutorial/NDSolveStateData can help. It lets you allow NDSolve to keep track of all the information the OP is asking about. The first step is to call NDSolve`ProcessEquation instead of NDSolve; the same arguments may be given, but note that an interval of integration is optional. Since the OP did not include a value for Tdrive, I left it out. I also ...


1

You can do this in a few ways, but the most elegant is to use the method in kguler's comment on your original post, which is just to divide: M = RandomReal[{-1, 1}, {3, 3, 500}]; div = RandomReal[{-1, 1}, {3, 3}]; result = M / div; Because the Divide (/) function has the Listable attribute, it automatically threads over the outer level of its arguments in ...



Top 50 recent answers are included