the word photon is one of the most confusing and misused words in physics. probably much more than other words in physics, it is being used with several different meanings and one can only try to find which one is meant based on the source and context of the message. the photon that spectroscopy experimenter uses to explain how spectra are connected to the atoms and molecules is a different concept from the photon quantum optics experimenters talk about when explaining their experiments. those are different from the photon that the high energy experimenters talk about and there are still other photons the high energy theorists talk about. there are probably even more variants ( and countless personal modifications ) in use. the term was introduced by g. n. lewis in 1926 for the concept of " atom of light " : [... ] one might have been tempted to adopt the hypothesis that we are dealing here with a new type of atom, an identifiable entity, uncreatable and indestructible, which acts as the carrier of radiant energy and, after absorption, persists as an essential constituent of the absorbing atom until it is later sent out again bearing a new amount of energy [... ] – " the origin of the word " photon " " i therefore take the liberty of proposing for this hypothetical new atom, which is not light but plays an essential part in every process of radiation, the name photon. – " the conservation of photons " ( 1926 - 12 - 18 ) as far as i know, this original meaning of the word photon is not used anymore, because all the modern variants allow for creation and destruction of photons. the photon the experimenter in visible - uv spectroscopy usually talks about is an object that has definite frequency $ \ nu $ and definite energy $ h \ nu $ ; its size and position are unknown, perhaps undefined ; yet it can be absorbed and emitted by a molecule. the photon the experimenter in quantum optics ( detection correlation studies ) usually talks about is a purposely mysterious " quantum object " that is more complicated : it has no definite frequency, has somewhat defined position and size, but can span whole experimental apparatus and only looks like a localized particle when it gets detected in a light detector. the photon the high energy experimenter talks about is a small particle that is not possible to see in photos of the particle tracks and their scattering events, but makes it easy to explain the curvature of tracks of matter particles with common point of origin within the framework of energy and momentum conservation ( e. g. appearance of pair of oppositely


charged particles, or the compton scattering ). this photon has usually definite momentum and energy ( hence also definite frequency ), and fairly definite position, since it participates in fairly localized scattering events. theorists use the word photon with several meanings as well. the common denominator is the mathematics used to describe electromagnetic field and its interaction with matter. certain special quantum states of em field - so - called fock states - behave mathematically in a way that allows one to use the language of " photons as countable things with definite energy ". more precisely, there are states of the em field that can be specified by stating an infinite set of non - negative whole numbers. when one of these numbers change by one, this is described by a figure of speech as " creation of photon " or " destruction of photon ". this way of describing state allows one to easily calculate the total energy of the system and its frequency distribution. however, this kind of photon cannot be localized except to the whole system. in the general case, the state of the em field is not of such a special kind, and the number of photons itself is not definite. this means the primary object of the mathematical theory of em field is not a set of point particles with definite number of members, but a continuous em field. photons are merely a figure of speech useful when the field is of a special kind. theorists still talk about photons a lot though, partially because : it is quite entrenched in the curriculum and textbooks for historical and inertia reasons ; experimenters use it to describe their experiments ; partially because it makes a good impression on people reading popular accounts of physics ; it is hard to talk interestingly about $ \ psi $ function or the fock space, but it is easy to talk about " particles of light " ; partially because of how the feynman diagram method is taught. ( in the feynman diagram, a wavy line in spacetime is often introduced as representing a photon. but these diagrams are a calculational aid for perturbation theory for complicated field equations ; the wavy line in the feynman diagram does not necessarily represent actual point particle moving through spacetime. the diagram, together with the photon it refers to, is just a useful graphical representation of certain complicated integrals. ) note on the necessity of the concept of photon many famous experiments once regarded as evidence for photons were later explained qualitatively or semi - quantitatively based solely based on the theory of waves ( classical em theory of light,


sometimes with schroedinger's equation added ). these are for example the photoelectric effect, compton scattering, black - body radiation and perhaps others. there always was a minority group of physicists who avoided the concept of photon altogether for this kind of phenomena and preferred the idea that the possibilities of em theory are not exhausted. check out these papers for non - photon approaches to physics : r. kidd, j. ardini, a. anton, evolution of the modern photon, am. j. phys. 57, 27 ( 1989 ) c. v. raman, a classical derivation of the compton effect. indian journal of physics, 3, 357 - 369. ( 1928 ) trevor w. marshall, emilio santos : the myth of the photon, arxiv ( 1997 ) timothy h. boyer, derivation of the blackbody radiation spectrum without quantum assumptions, phys. rev. 182, 1374 ( 1969 )


if you want the shifted output of the ifft to be real, the phase twist / rotation in the frequency domain has to be conjugate symmetric, as well as the data. this can be accomplished by adding an appropriate offset to your complex exp ( )'s exponent, for the given phase slope, so that the phase of the upper ( or negative ) half, modulo 2 pi, mirrors the lower half in the fft aperture. the complex exponential shift function can also be made conjugate symmetric by indexing it from - n / 2 to n / 2 with a phase of zero at index 0. it just so happens that the appropriate offset for phase twists or spirals, that complete an exact integer multiples of 2 pi rotations in aperture, to be conjugate symmetric in aperture, is zero. with a conjugate symmetric phase twist vector, the result should then end up as a circular sinc interpolation for non - integer shifts. elaboration by op : your choice of k = [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ] is producing an asymmetrical complex exponential : if you use k = [ 0, 1, 2, 3, 4, - 4, - 3, - 2, - 1 ] instead, you get a hermite - symmetric complex exponential : plot ( fftshift ( exp ( - 1j * 2 * pi * 0. 5 / n * k ) ) ) and now when you use the same exponential formula to shift by 0. 5 or 3. 5 samples, you get a real result : plot ifft ( fft ( a ) * exp ( - 1j * 2 * pi * 0. 5 / n * k ) ) plot ifft ( fft ( a ) * exp ( - 1j * 2 * pi * 3. 5 / n * k ) )


there are huge differences in culture, coding style, and capabilities. probably the fundamental difference is trilinos tries to provide an environment for solving fem problems and petsc provides an environment for solving sparse linear algebra problems. why is that significant? trilinos will provide a large number of packages concerned with separate parts of the fem solver. sometimes these packages work together sometimes they don't. even the base components are in its own package and advanced c + + tools petsc provides a small amount of core routines that can be built upon, but leaves the fem solvers to third party packages. because of this, it is associated with a larger community than just fem. for example, even the eigen solvers are third party which is arguably a major part of linear algebra. bottom line, trilinos focuses working well within its own packages and petsc has interfaces that call out to many middleware packages ( i've often heard it called " lighter - weight " because of this but i wouldn't make that claim ) imho, which you should use really depends on the problem. please share more details for us to answer that question.


the misunderstanding lies in what constitutes " solving " an optimization problem, e. g. $ \ arg \ min f ( x ) $. for mathematicians, the problem is only considered " solved " once we have : a candidate solution : a particular choice of the decision variable $ x ^ \ star $ and its corresponding objective value $ f ( x ^ \ star ) $, and a proof of optimality : a mathematical proof that the choice of $ x ^ \ star $ is globally optimal, i. e. that $ f ( x ) \ ge f ( x ^ \ star ) $ holds for every choice of $ x $. when $ f $ is convex, both ingredients are readily obtained. gradient descent locates a candidate solution $ x ^ \ star $ that makes the gradient vanish $ \ nabla f ( x ^ \ star ) = 0 $. the proof of optimality follows from a simple fact taught in math101 that, if $ f $ is convex, and its gradient $ \ nabla f $ vanishes at $ x ^ \ star $, then $ x ^ \ star $ is a global solution. when $ f $ is nonconvex, a candidate solution may still be easy to find, but the proof of optimality becomes extremely difficult. for example, we may run gradient descent and find a point $ \ nabla f ( x ^ \ star ) = 0 $. but when $ f $ is nonconvex, the condition $ \ nabla f ( x ) = 0 $ is necessary but no longer sufficient for global optimality. indeed, it is not even sufficient for local optimality, i. e. we cannot even guarantee that $ x ^ \ star $ is a local minimum based on its gradient information alone. one approach is to enumerate all the points satisfying $ \ nabla f ( x ) = 0 $, and this can be a formidable task even over just one or two dimensions. when mathematicians say that most problems are impossible to solve, they are really saying that the proof of ( even local ) optimality is impossible to construct. but in the real world, we are often only interested in computing a " good - enough " solution, and this can be found in an endless number of ways. for many highly nonconvex problems, our intuition tells us that the " good - enough " solutions are actually globally optimal, even if we are completely unable to prove it!


for the shield to be effective, it requires as low impedance connection as possible to your shield ground. i think those recommending resistors, or not connecting it to ground at all, or strictly talking about your digital logic ground, and assuming you have a separate shield ground. if you have a metal enclosure, this will be your shield ground. at some point, your digital ground must connect to your shield ground. for emi reasons, this single point should be close to your i / o area. this means it's best to place your usb connector with any other i / o connectors around one section of the board and locate your shield to logic ground point at that location. there are some exceptions to the single point, rule, if you have a solid metal enclosure without any apertures, for example, multiple connection points can be helpful. in any case, at shield to circuit ground connection, some may recommend using a resistor or capacitor ( or both ) but rarely is there a reasonable reason to do this. you want a low inductance connection between the two to provide a path for common mode noise. why divert noise though parasitic capacitance ( e. g. radiate it out into the environment )? the only reason usually given for such tactics is to prevent ground loops, but you're talking about usb, ground loops most likely won't be an issue for most usb applications. granted, such tactics will prevent ground loops, but they will also rend your shielding all but ineffective.


if this is a topic that really interests you, i'd suggest searching for papers / reviews / opinions written by didier raoult. raoult is one of the original discoverers of the massive mimivirus and his work will lead you to some truly fascinating discussions that i couldn't hope to reproduce here. the main argument for why viruses aren't living is basically what has been said already. viruses are obligate parasites, and while plenty of parasites are indeed living what sets viruses apart is that they always rely on the host for the machinery with which to replicate. a parasitic worm may need the host to survive, using the host as a source for energy, but the worm produces and synthesizes its own proteins using its own ribosomes and associated complexes. that's basically what it boils down to. no ribosomes? not living. one advantage of this definition, for example, is that it is a positive selection ( everyone " alive " has got ribosomes ) which eliminates things like mitochondria that are sort of near the boundary of other definitions. there are examples on either side of something that breaks every other rule but not this one. another common rule is metabolism and while that suffices for most cases some living parasites have lost metabolic activity, relying on their host for energy. however ( and this is the really interesting part ) even the ribosome definition is a bit shaky, especially as viruses have been found encoding things like their own trnas. here are a few points to think about : we have ribosome encoding organisms ( reos ), so why can't we define viruses as capsid encoding organisms ( ceos )? comparing viruses to a living organism such as a human is absurd, given the massive differences in complexity. a virus, really, is just a vehicle or genetic material, and would be more rightly compared to a sperm cell. is a sperm cell alive, or is it a package for genetic material that is capable of life once it has infected / fertilized another cell? the really large dna viruses often create cytoplasmic features called virus factories. these look an awful lot like a nucleus. what is a nucleus anyway? maybe it's just a very successful dna virus that never left. viruses can get viruses. i'll wind down here, but suffice to say that while our current definition may have sufficed for a while, and still does, it is no longer quite solid. in particular, there is a


theory alluded to above that eukaryotic life itself actually formed because of viruses. i can expand on this if you like, but here are some great sources : boyer, m., yutin, n., pagnier, i., et al. 2009. giant marseillevirus highlights the role of amoebae as a melting pot in emergence of chimeric microorganisms. pnas. 106 ( 51 ) : 21848 - 21853 ( claverie, jm. viruses take center stage in cellular evolution. 2006. genome biology. 7 : 110. ( ogata, h., ray, j., toyoda, k., et al. 2011. two new subfamilies of dna mismatch repair proteins ( muts ) specifically abundant in the marine environment. the isme journal. 5 : 1143 - 1151 ( raoult, d. and forterre, p. 2008. redefining viruses : lessons from mimivirus. nature reviews microbiology. 6 : 315 - 319. ( scola, b., desnues, c., pagnier, i., et al. the virophage as a unique parasite of the giant mimivirus. 2008. nature. 455 : 100 - 104 (


i'm not sure but i think the answer is no, for rather subtle reasons. i asked on theoretical computer science a few years ago and didn't get an answer that goes beyond what i'll present here. in most programming languages, you can simulate a turing machine by : simulating the finite automaton with a program that uses a finite amount of memory ; simulating the tape with a pair of linked lists of integers, representing the content of the tape before and after the current position. moving the pointer means transferring the head of one of the lists onto the other list. a concrete implementation running on a computer would run out of memory if the tape got too long, but an ideal implementation could execute the turing machine program faithfully. this can be done with pen and paper, or by buying a computer with more memory, and a compiler targeting an architecture with more bits per word and so on if the program ever runs out of memory. this doesn't work in c because it's impossible to have a linked list that can grow forever : there's always some limit on the number of nodes. to explain why, i first need to explain what a c implementation is. c is actually a family of programming languages. the iso c standard ( more precisely, a specific version of this standard ) defines ( with the level of formality that english allows ) the syntax and semantics a family of programming languages. c has a lot of undefined behavior and implementation - defined behavior. an “ implementation ” of c codifies all the implementation - defined behavior ( the list of things to codify is in appendix j for c99 ). each implementation of c is a separate programming language. note that the meaning of the word “ implementation ” is a bit peculiar : what it really means is a language variant, there can be multiple different compiler programs that implement the same language variant. in a given implementation of c, a byte has $ 2 ^ { \ texttt { char _ bit } } $ possible values. all data can represented as an array of bytes : a type t has at most $ 2 ^ { \ texttt { char _ bit } \ times \ texttt { sizeof ( t ) } } $ possible values. this number varies in different implementations of c, but for a given implementation of c, it's a constant. in particular, pointers can only take at most $ 2 ^ { \ texttt { char _ bit } \ times \ texttt { sizeof ( void * ) } }


$ values. this means that there is a finite maximum number of addressable objects. the values of char _ bit and sizeof ( void * ) are observable, so if you run out of memory, you can't just resume running your program with larger values for those parameters. you would be running the program under a different programming language — a different c implementation. if programs in a language can only have a bounded number of states, then the programming language is no more expressive than finite automata. the fragment of c that's restricted to addressable storage only allows at most $ n \ times 2 ^ { \ texttt { char _ bit } \ times \ texttt { sizeof ( void * ) } } $ program states where $ n $ is the size of the abstract syntax tree of the program ( representing the state of the control flow ), therefore this program can be simulated by a finite automaton with that many states. if c is more expressive, it has to be through the use of other features. c does not directly impose a maximum recursion depth. an implementation is allowed to have a maximum, but it's also allowed not to have one. but how do we communicate between a function call and its parent? arguments are no good if they're addressable, because that would indirectly limit the depth of recursion : if you have a function int f ( int x ) { … f ( … ) … } then all the occurrences of x on active frames of f have their own address and so the number of nested calls is bounded by the number of possible addresses for x. a c program can use non - addressable storage in the form of register variables. “ normal ” implementations can only have a small, finite number of variables that don't have an address, but in theory an implementation could allow an unbounded amount of register storage. in such an implementation, you can make an unbounded amount of recursive calls to a function, as long as its argument are register. but since the arguments are register, you can't make a pointer to them, and so you need to copy their data around explicitly : you can only pass around a finite amount of data, not an arbitrary - sized data structure that's made of pointers. with unbounded recursion depth, and the restriction that a function can only get data from its direct caller ( register arguments ) and return data to its direct caller ( the function return value ), you


get the power of deterministic pushdown automata. i can't find a way to go further. ( of course you could make the program store the tape content externally, through file input / output functions. but then you wouldn't be asking whether c is turing - complete, but whether c plus an infinite storage system is turing - complete, to which the answer is a boring “ yes ”. you might as well define the storage to be a turing oracle — call fopen ( " oracle ", " r + " ), fwrite the initial tape content to it and fread back the final tape content. )


the state \ begin { equation } | \ psi \ rangle = \ frac { 1 } { \ sqrt { 2 } } \ left ( | \ psi _ 1 \ rangle + | \ psi _ 2 \ rangle \ right ) \ end { equation } is a pure state. meaning, there's not a 50 % chance the system is in the state $ | \ psi _ 1 \ rangle $ and a 50 % it is in the state $ | \ psi _ 2 \ rangle $. there is a 0 % chance that the system is in either of those states, and a 100 % chance the system is in the state $ | \ psi \ rangle $. the point is that these statements are all made before i make any measurements. it is true that if i measure the observable corresponding to $ \ psi $ ( $ \ psi $ - gular momentum : ) ), then there is a 50 % chance after collapse the system will end up in the state $ | \ psi _ 1 \ rangle $. however, let's say i choose to measure a different observable. let's say the observable is called $ \ phi $, and let's say that $ \ phi $ and $ \ psi $ are incompatible observables in the sense that as operators $ [ \ hat { \ psi }, \ hat { \ phi } ] \ neq0 $. ( i realize i'm using $ \ psi $ in a sense you didn't originally intend but hopefully you know what i mean ). the incompatibliity means that $ | \ psi _ 1 \ rangle $ is not just proportional to $ | \ phi _ 1 \ rangle $, it is a superposition of $ | \ phi _ 1 \ rangle $ and $ | \ phi _ 2 \ rangle $ ( the two operators are not simulatenously diagonalized ). then we want to re - express $ | \ psi \ rangle $ in the $ \ phi $ basis. let's say that we find \ begin { equation } | \ psi \ rangle = | \ phi _ 1 \ rangle \ end { equation } for example, this would happen if \ begin { equation } | \ psi _ 1 \ rangle = \ frac { 1 } { \ sqrt { 2 } } ( | \ phi _ 1 \ rangle + | \ phi _ 2 \ rangle ) \ end {


equation } \ begin { equation } | \ psi _ 2 \ rangle = \ frac { 1 } { \ sqrt { 2 } } ( | \ phi _ 1 \ rangle - | \ phi _ 2 \ rangle ) \ end { equation } then i can ask for the probability of measuring $ \ phi $ and having the system collapse to the state $ | \ phi _ 1 \ rangle $, given that the state is $ | \ psi \ rangle $, it's 100 %. so i have predictions for the two experiments, one measuring $ \ psi $ and the other $ \ phi $, given knowledge that the state is $ \ psi $. but now let's say that there's a 50 % chance that the system is in the pure state $ | \ psi _ 1 \ rangle $, and a 50 % chance the system is in the pure state $ | \ psi _ 2 \ rangle $. not a superposition, a genuine uncertainty as to what the state of the system is. if the state is $ | \ psi _ 1 \ rangle $, then there is a 50 % chance that measuring $ \ phi $ will collapse the system into the state $ | \ phi _ 1 \ rangle $. meanwhile, if the state is $ | \ psi _ 2 \ rangle $, i get a 50 % chance of finding the system in $ | \ phi _ 1 \ rangle $ after measuring. so the probability of measuring the system in the state $ | \ phi _ 1 \ rangle $ after measuring $ \ phi $, is ( 50 % being in $ \ psi _ 1 $ ) ( 50 % measuring $ \ phi _ 1 $ ) + ( 50 % being in $ \ psi _ 2 $ ) ( 50 % measuring $ \ phi _ 1 $ ) = 50 %. this is different than the pure state case. so the difference between a'density matrix'type uncertainty and a'quantum superposition'of a pure state lies in the ability of quantum amplitudes to interfere, which you can measure by preparing many copies of the same state and then measuring incompatible observables.


first off, don ’ t use rpkms. they are truly deprecated because they ’ re confusing once it comes to paired - end reads. if anything, use fpkms, which are mathematically the same but use a more correct name ( do we count paired reads separately? no, we count fragments ). even better, use tpm ( = transcripts per million ), or an appropriate cross - library normalisation method. tmp is defined as : $ $ \ text { tpm } _ \ color { orchid } i = { \ color { dodgerblue } { \ frac { x _ \ color { orchid } i } { { l _ \ text { eff } } _ \ color { orchid } i } } } \ cdot \ frac { 1 } { \ sum _ \ color { tomato } j \ color { dodgerblue } { \ frac { x _ \ color { tomato } j } { { l _ \ text { eff } } _ \ color { tomato } j } } } \ cdot \ color { darkcyan } { 10 ^ 6 } $ $ where $ \ color { orchid } i $ : transcript index, $ x _ i $ : transcript raw count, $ \ color { tomato } j $ iterates over all ( known ) transcripts, $ \ color { dodgerblue } { \ frac { x _ k } { { l _ \ text { eff } } _ k } } $ : rate of fragment coverage per nucleobase ( $ l _ \ text { eff } $ being the effective length ), $ \ color { darkcyan } { 10 ^ 6 } $ : scaling factor ( = “ per millions ” ). that said, fpkm can be calculated in r as follows. note that most of the calculation happens in log transformed number space, to avoid numerical instability : fpkm = function ( counts, effective _ lengths ) { exp ( log ( counts ) - log ( effective _ lengths ) - log ( sum ( counts ) ) + log ( 1e9 ) ) } here, the effective length is the transcript length minus the mean fragment length plus 1 ; that is, all the possible positions of an average fragment inside the transcript, which equals the number of all distinct fragments that can be sampled from a transcript. this function handles one library at a time. i ( and others ) argue that this is the way functions should be


written. if you want to apply the code to multiple libraries, nothing is easier using dplyr › : tidy _ expression = tidy _ expression % > % group _ by ( sample ) % > % mutate ( fpkm = fpkm ( count, col _ data $ lengths ) ) however, the data in the question isn ’ t in tidy data format, so we first need to transform it accordingly using tidyr › : tidy _ expression = expression % > % pivot _ longer ( names _ to = sample, values _ to = count ) this equation fails if all your counts are zero ; instead of zeros you will get a vector of nans. you might want to account for that. and i mentioned that tpms are superior, so here ’ s their function as well : tpm = function ( counts, effective _ lengths ) { rate = log ( counts ) - log ( effective _ lengths ) exp ( rate - log ( sum ( exp ( rate ) ) ) + log ( 1e6 ) ) }


two bits to this answer ; firstly, the class of languages recognised by turing machines is not context sensitive, it's recursively enumerable ( context sensitive is the class of languages you get from linear bound automata ). the second part, assuming we adjust the question, is that yes, a two - stack pda is as powerful as a tm. it's mildly simpler to assume that we're using the model of tms that has a tape that's infinite in one direction only ( though both directions is not much harder, and equivalent ). to see the equivalence, just think of the first stack as the contents of the tape to the left of the current position, and the second as the contents to the right. you start off like so : push the normal " bottom of stack " markers on both stacks. push the input to the left stack ( use non - determinism to " guess " the end of the input ). move everything to the right stack ( to keep things in the proper order ). now you can ignore the input and do everything on the contents of the stacks ( which is simulating the tape ). you pop to read and push to write ( so you can change the " tape " by pushing something different to what you read ). then we can simulate the tm by popping from the right stack and pushing to the left to move right, and vice versa to move left. if we hit the bottom of the left stack we behave accordingly ( halt and reject, or stay where you, depending on the model ), if we hit the bottom of the right stack, we just push a blank symbol onto the left. for a full formal proof, see an answer to another question. the relationship the other way should be even more obvious, i. e. that we can simulate a two - stack pda with a tm.


the best solution that i know of is to program the symbolic expressions in mathematica, maple, or sympy ; all of the links go directly to the code generation documentation. all of the programs above can generate code in c or fortran. none of the programs above mentions accuracy in ieee 754 arithmetic ; in general, it would be difficult to anticipate all sources of catastrophic cancellation, as @ dmckee notes. it's hard to replace human expertise in numerical analysis. to provide a concrete example, consider calculating the trigonometric functions to high precision for arbitrary inputs in $ [ 0, 2 \ pi ] $. there are many strategies for doing so, some even hardware dependent, as see in the wikipedia article trigonometric tables. all of the algorithms require ingenuity and numerical analysis, even algorithms that depend on lookup tables and taylor series or interpolation ( see the wikipedia article the table - maker's dilemma ). for more detail, see the related stack overflow question how do trigonometric functions work?. software that generated code or routines to calculate arbitrary functions to high accuracy would not only need to be aware of cancellation errors, but also series approximants ( taylor, pade, chebyshev, rational, etc. ) for calculating functions that are not defined in terms of a finite number of additions, subtractions, multiplications, divisions, and bit shifts. ( see approximation theory. )


this terminology goes waaaaay back to the days of vacuum tubes. generally, you would mount a number of tube - sockets on standoffs to a piece of wood ( the actual " breadboard " ), and do all the wiring with point - point wire and the components just hanging between the various devices. if you needed additional connection points, you would use a solder - lug terminal strip. image credit : random googling. the story goes that an engineer had an idea for a vacuum tube device late one night. looking around the house, the only base for his prototype that he found was indeed his wife's breadboard, from the breadbox. now, i'm not endorsing actually using a real breadboard. it's your marital strife if you do. i've actually constructed a tube project using the breadboard technique. it works very well.


relays offer complete isolation between the activating circuit and the load. they can switch ac and dc, and be activated by ac or dc. they can be very robust. they also have the advantage that one can often see if the device is actuated, and one can even hear the actuation in many cases.


unlike your question suggests, it is not true that velocity is varied independently of position. a variation of position $ q \ mapsto q + \ delta q $ induces a variation of velocity $ \ partial _ t q \ mapsto \ partial _ t q + \ partial _ t ( \ delta q ) $ as you would expect. the only thing that may seem strange is that $ q $ and $ \ partial _ t q $ are treated as independent variables of the lagrangian $ l ( q, \ partial _ t q ) $. but this is not surprising ; after all, if you ask " what is the kinetic energy of a particle? ", then it is not enough to know the position of the particle, you also have to know its velocity to answer that question. put differently, you can choose position and velocity independently as initial conditions, that's why the lagrangian function treats them as independent ; but the calculus of variation does not vary them independently, a variation in position induces a fitting variation in velocity.


higher spin particles have to be coupled to conserved currents, and there are no conserved currents of high spin in quantum field theories. the only conserved currents are vector currents associated with internal symmetries, the stress - energy tensor current, the angular momentum tensor current, and the spin - 3 / 2 supercurrent, for a supersymmetric theory. this restriction on the currents constrains the spins to 0, 1 / 2 ( which do not need to be coupled to currents ), spin 1 ( which must be coupled to the vector currents ), spin 3 / 2 ( which must be coupled to a supercurrent ) and spin 2 ( which must be coupled to the stress - energy tensor ). the argument is heuristic, and i do not think it rises to the level of a mathematical proof, but it is plausible enough to be a good guide. preliminaries : all possible symmetries of the s - matrix you should accept the following result of o'raferteigh, coleman and mandula - - - the continuous symmetries of the particle s - matrix, assuming a mass - gap and lorentz invariance, are a lie group of internal symmetries, plus the lorentz group. this theorem is true, given its assumptions, but these assumptions leave out a lot of interesting physics : coleman - mandula assume that the symmetry is a symmetry of the s - matrix, meaning that it acts nontrivially on some particle state. this seems innocuous, until you realize that you can have a symmetry which doesn't touch particle states, but only acts nontrivially on objects like strings and membranes. such symmetries would only be relevant for the scattering of infinitely extended infinite energy objects, so it doesn't show up in the s - matrix. the transformations would become trivial whenever these sheets close in on themselves to make a localized particle. if you look at coleman and mandula's argument ( a simple version is presented in argyres'supersymmetry notes, which gives the flavor. there is an excellent complete presentation in weinberg's quantum field theory book, and the original article is accessible and clear ), it almost begs for the objects which are charged under the higher symmetry to be spatially extended. when you have extended fundamental objects, it is not clear that you are doing field theory anymore. if the extended objects are solitons in a renormalizable field theory, you can zoom in on


ultra - short distance scattering, and consider the ultra - violet fixed point theory as the field theory you are studying, and this is sufficient to understand most examples. but the extended - object exception is the most important one, and must always be kept in the back of the mind. coleman and mandula assume a mass gap. the standard extension of this theorem to the massless case just extends the maximal symmetry from the poincare group to the conformal group, to allow the space - time part to be bigger. but coleman and madula use analyticity properties which i am not sure can be used in a conformal theory with all the branch - cuts which are not controlled by mass - gaps. the result is extremely plausible, but i am not sure if it is still rigorously true. this is an exercise in weinberg, which unfortunately i haven't done. coleman and mandula ignore supersymmetries. this is fixed by haag – lopuszanski – sohnius, who use the coleman mandula theorem to argue that the maximal symmetry structure of a quantum field theory is a superconformal group plus internal symmetries, and that the supersymmetry must close on the stress - energy tensor. what the coleman mandula theorem means in practice is that whenever you have a conserved current in a quantum field theory, and this current acts nontrivially on particles, then it must not carry any space - time indices other than the vector index, with the only exceptions being the geometric currents : a spinor supersymmetry current, $ j ^ { \ alpha \ mu } $, the ( belinfante symmetric ) stress - energy tensor $ t ^ { \ mu \ nu } $, the ( belinfante ) angular momentum tensor $ s ^ { \ mu \ nu \ lambda } = x ^ { \ mu } t ^ { \ nu \ lambda } - x ^ \ nu t ^ { \ mu \ lambda } $, and sometimes the dilation current $ d ^ \ mu = x ^ \ mu t ^ \ alpha _ \ alpha $ and conformal and superconformal currents too. the spin of the conserved currents is found by representation theory - - - antisymmetric indices are spin 1, whether there are 1 or 2, so the spin of the internal symmetry currents is 1, and of the stress energy tensor is 2. the other geometric tensors derived from the stress energy tensor are also restricted to spin less then 2,


with the supercurrent having spin 3 / 2. what is a qft? here this is a practical question - - - for this discussion, a quantum field theory is a finite collection of local fields, each corresponding to a representation of the poincare group, with a local interaction lagrangian which couples them together. further, it is assumed that there is an ultra - violet regime where all the masses are irrelevant, and where all the couplings are still relatively small, so that perturbative particle exchange is ok. i say pseudo - limit, because this isn't a real ultra - violet fixed point, which might not exist, and it does not require renormalizability, only unitarity in the regime where the theory is still perturbative. every particle must interact with something to be part of the theory. if you have a noninteracting sector, you throw it away as unobservable. the theory does not have to be renormalizable, but it must be unitary, so that the amplitudes must unitarize perturbatively. the couplings are assumed to be weak at some short distance scale, so that you don't make a big mess at short distances, but you can still analyze particle emission order by order the froissart bound for a mass - gap theory states that the scattering amplitude cannot grow faster than the logarithm of the energy. this means that any faster than constant growth in the scattering amplitude must be cancelled by something. propagators for any spin the propagators for massive / massless particles of any spin follow from group theory considerations. these propagators have the schematic form $ $ s ^ j \ over s - m ^ 2 $ $ and the all - important s scaling, with its j - dependence can be extracted from the physically obvious angular dependence of the scattering amplitude. if you exchange a spin - j particle with a short propagation distance ( so that the mass is unimportant ) between two long plane waves ( so that their angular momentum is zero ), you expect the scattering amplitude to go like $ \ cos ( \ theta ) ^ j $, just because rotations act on the helicity of the exchanged particle with this factor. for example, when you exchange an electron between an electron and a positron, forming two photons, and the internal electron has an average momentum k and a helicity +, then if you rotate the contribution to


the scattering amplitude from this exchange around the k - axis by an angle $ \ theta $ counterclockwise, you should get a phase of $ \ theta / 2 $ in the outgoing photon phases. in terms of mandelstam variables, the angular amplitude goes like $ ( 1 - t ) ^ j $, since t is the cosine of the scattering variable, up to some scaling in s. for large t, this grows as t ^ j, but " t " is the " s " of a crossed channel ( up to a little bit of shifting ), and so crossing t and s, you expect the growth to go with the power of the angular dependence. the denominator is fixed at $ j = 0 $, and this law is determined by regge theory. so that for $ j = 0, 1 / 2 $, the propagators shrink at large momentum, for $ j = 1 $, the scattering amplitudes are constant in some directions, and for $ j > 1 $ they grow. this schematic structure is of course complicated by the actual helicity states you attach on the ends of the propagator, but the schematic form is what you use in weinberg's argument. spin 0, 1 / 2 are ok that spin 0 and 1 / 2 are ok with no special treatment, and this argument shows you why : the propagator for spin 0 is $ $ 1 \ over k ^ 2 + m ^ 2 $ $ which falls off in k - space at large k. this means that when you scatter by exchanging scalars, your tree diagrams are shrinking, so that they don't require new states to make the theory unitary. spinors have a propagator $ $ 1 \ over \ gamma \ cdot k + m $ $ this also falls off at large k, but only linearly. the exchange of spinors does not make things worse, because spinor loops tend to cancel the linear divergence by symmetry in k - space, leaving log divergences which are symptomatic of a renormalizable theory. so spinors and scalars can interact without revealing substructure, because their propagators do not require new things for unitarization. this is reflected in the fact that they can make renormalizable theories all by themselves. spin 1 introducing spin 1, you get a propagator that doesn't fall off. the massive propagator for spin 1 is


$ $ { g _ { \ mu \ nu } - { k _ \ mu k _ \ nu \ over m ^ 2 } \ over k ^ 2 + m ^ 2 } $ $ the numerator projects the helicity to be perpendicular to k, and the second term is problematic. there are directions in k - space where the propagator does not fall off at all! this means that when you scatter by spin - 1 exchange, these directions can lead to a blow - up in the scattering amplitude at high energies which has to be cancelled somehow. if you cancel the divergence with higher spin, you get a divergence there, and you need to cancel that, and then higher spin, and so on, and you get infinitely many particle types. so the assumption is that you must get rid of this divergence intrinsically. the way to do this is to assume that the $ k _ \ mu k _ \ nu $ term is always hitting a conserved current. then it's contribution vanishes. this is what happens in massive electrodynamics. in this situation, the massive propagator is still ok for renormalizability, as noted by schwinger and feynman, and explained by stueckelberg. the $ k _ \ mu k _ \ nu $ is always hitting a $ j ^ \ mu $, and in x - space, it is proportional to the divergence of the current, which is zero because the current is conserved even with a massive photon ( because the photon isn't charged ). the same argument works to kill the k - k part of the propagator in yang - mills fields, but it is much more complicated, because the yang - mills field itself is charged, so the local conservation law is usually expressed in a different way, etc, etc. the heuristic lesson is that spin - 1 is only ok if you have a conservation law which cancels the non - shrinking part of the numerator. this requires yang - mills theory, and the result is also compatible with renormalizability. if you have a spin - 1 particle which is not a yang - mills field, you will need to reveal new structure to unitarize its longitudinal component, whose propagator is not properly shrinking at high energies. spin 3 / 2 in this case, you have a rarita schwinger field, and the propagator is going to grow like $ \ sqrt { s } $ at


large energies, just from the mandelstam argument presented before. the propagator growth leads to unphysical growth in scattering exchanging this particle, unless the spin - 3 / 2 field is coupled to a conserved current. the conserved current is the supersymmetry current, by the haag – lopuszanski – sohnius theorem, because it is a spinor of conserved currents. this means that the spin - 3 / 2 particle should interact with a spin 3 / 2 conserved supercurrent in order to be consistent, and the number of gravitinos is ( less then or equal to ) the number of supercharges. the gravitinos are always introduced in a supermultiplet with the graviton, but i don't know if it is definitely impossible to introduce them with a spin - 1 partner, and couple them to the supercurrent anyway. these spin - 3 / 2 / spin - 1 multiplets will probably not be renormalizable barring some supersymmetry miracle. i haven't worked it out, but it might be possible. spin 2 in this case, you have a perturbative graviton - like field $ h _ { \ mu \ nu } $, and the propagator contains terms growing linearly with s. in order to cancel the growth in the numerator, you need the tensor particle to be coupled to a conserved current to kill the parts with too - rapid growth, and produce a theory which does not require new particles for unitarity. the conserved quantity must be a tensor $ t _ { \ mu \ nu } $. now one can appeal to the coleman mandula theorem and conclude that the conserved tensor current must be the stress energy tensor, and this gives general relativity, since the stress - tensor includes the stress of the h field too. there is a second tensor conserved quantity, the angular momentum tensor $ s _ { \ mu \ nu \ sigma } $, which is also spin - 2 ( it might look like its spin 3, but its antisymmetric on two of its indices ). you can try to couple a spin - 2 field to the angular momentum tensor. to see if this works requires a detailed analysis, which i haven't done, but i would guess that the result will just be a non - dynamical torsion coupled to the local spin, as required by the einstein - cartan theory. witten mentions yet another possi


##blity for spin 2 in chapter 1 of green schwarz and witten, but i don't remember what it is, and i don't know whether it is viable. summary i believe that these arguments are due to weinberg, but i personally only read the sketchy summary of them in the first chapters of green schwarz and witten. they do not seem to me to have the status of a theorem, because the argument is particle by particle, it requires independent exchange in a given regime, and it discounts the possiblity that unitary can be restored by some family of particles. of course, in string theory, there are fields of arbitrarily high spin, and unitarity is restored by propagating all of them together. for field theories with bound states which lie on regge trajectories, you can have arbitrarily high spins too, so long as you consider all the trajectory contributions together, to restore unitarity ( this was one of the original motivations for regge theory - - - unitarizing higher spin theories ). for example, in qcd, we have nuclei of high ground - state spin. so there are stable s - matrix states of high spin, but they come in families with other excited states of the same nuclei. the conclusion here is that if you have higher spin particles, you can be pretty sure that you will have new particles of even higher spin at higher energies, and this chain of particles will not stop until you reveal new structure at some point. so the tensor mesons observed in the strong interaction mean that you should expect an infinite family of strongly interacting particles, petering out only when the quantum field substructure is revealed. some comments james said : it seems higher spin fields must be massless so that they have a gauge symmetry and thus a current to couple to a massless spin - 2 particle can only be a graviton. these statements are as true as the arguments above are convincing. from the cancellation required for the propagator to become sensible, higher spin fields are fundamentally massless at short distances. the spin - 1 fields become massive by the higgs mechanism, the spin 3 / 2 gravitinos become massive through spontaneous susy breaking, and this gets rid of goldstone bosons / goldstinos. but all this stuff is, at best, only at the " mildly plausible " level of argument - - - the argument is over propagator unitarization with each propagator separately having


no cancellations. it's actually remarkable that it works as a guideline, and that there aren't a slew of supersymmetric exceptions of higher spin theories with supersymmetry enforcing propagator cancellations and unitarization. maybe there are, and they just haven't been discovered yet. maybe there's a better way to state the argument which shows that unitarity can't be restored by using positive spectral - weight particles. big rift in 1960s james askes why wasn't this pointed out earlier in the history of string theory? the history of physics cannot be well understood without appreciating the unbelievable antagonism between the chew / mandelstam / gribov s - matrix camp, and the weinberg / glashow / polyakov field theory camp. the two sides hated each other, did not hire each other, and did not read each other, at least not in the west. the only people that straddled both camps were older folks and russians - - - gell - mann more than landau ( who believed the landau pole implied s - matrix ), gribov and migdal more than anyone else in the west other than gell - mann and wilson. wilson did his phd in s - matrix theory, for example, as did david gross ( under chew ). in the 1970s, s - matrix theory just plain died. all practitioners jumped ship rapidly in 1974, with the triple - whammy of wilsonian field theory, the discovery of the charm quark, and asymptotically freedom. these results killed s - matrix theory for thirty years. those that jumped ship include all the original string theorists who stayed employed : notably veneziano, who was convinced that gauge theory was right when t'hooft showed that large - n gauge fields give the string topological expansion, and susskind, who didn't mention regge theory after the early 1970s. everybody stopped studying string theory except scherk and schwarz, and schwarz was protected by gell - mann, or else he would never have been tenured and funded. this sorry history means that not a single s - matrix theory course is taught in the curriculum today, nobody studies it except a few theorists of advanced age hidden away in particle accelerators, and the main s - matrix theory, string - theory, is not properly explained and remains completely enigmatic even to most physicists. there were some good reasons for this - - - some s - matrix


people said silly things about the consistency of quantum field theory - - - but to be fair, quantum field theory people said equally silly things about s - matrix theory. weinberg came up with these heuristic arguments in the 1960s, which convinced him that s - matrix theory was a dead end, or rather, to show that it was a tautological synonym for quantum field theory. weinberg was motivated by models of pion - nucleon interactions, which was a hot s - matrix topic in the early 1960s. the solution to the problem is the chiral symmetry breaking models of the pion condensate, and these are effective field theories. building on this result, weinberg became convinced that the only real solution to the s - matrix was a field theory of some particles with spin. he still says this every once in a while, but it is dead wrong. the most charitable interpretation is that every s - matrix has a field theory limit, where all but a finite number of particles decouple, but this is not true either ( consider little string theory ). string theory exists, and there are non - field theoretic s - matrices, namely all the ones in string theory, including little string theory in ( 5 + 1 ) d, which is non - gravitational. lorentz indices james comments : regarding spin, i tried doing the group theoretic approach to an antisymmetric tensor but got a little lost - doesn't an antisymmetric 2 - form ( for example ) contain two spin - 1 fields? the group theory for an antisymmetric tensor is simple : it consists of an " e " and " b " field which can be turned into the pure chiral representations e + ib, e - ib. this was also called a " six - vector " sometimes, meaning e, b making an antisymmetric four - tensor. you can do this using dotted and undotted indices more easily, if you realize that the representation theory of su ( 2 ) is best done in indices - - - see the " warm up " problem in this answer : mathematically, what is color charge?


initial advice always run with - ksp _ converged _ reason - ksp _ monitor _ true _ residual when trying to learn why a method is not converging. make the problem size and number of processes as small as possible to demonstrate the failure. you often gain insight by determining what small problems exhibit the behavior that is causing your method to break down and the turn - around time is reduced. additionally, there are some investigation techniques that can only be used for small systems. if the issue only arises after a large number of time steps, continuation steps, or nonlinear solve steps, consider writing the model state out when failure occurs so that you can experiment quickly. alternatively, especially if your software does not have checkpoint capability, use - ksp _ view _ binary or matview ( ) to save the linear system, then use the code at $ petsc _ dir / src / ksp / ksp / examples / tutorials / ex10. c to read in the matrix and solve it ( possibly with a different number of processes ). this requires an assembled matrix, so it's usefulness can be somewhat limited. there are many possible solver choices ( e. g. an infinite number available at the command line in petsc due to an arbitrary number of levels of composition ), see this question for general advice on choosing linear solvers. common reasons for ksp not converging the equations are singular by accident ( e. g. forgot to impose boundary conditions ). check this for a small problem using - pc _ type svd - pc _ svd _ monitor. also try a direct solver with - pc _ type lu ( via a third - party package in parallel, e. g. - pc _ type lu - pc _ factor _ mat _ solver _ package superlu _ dist ). the equations are intentionally singular ( e. g. constant null space ), but the krylov method was not informed, see kspsetnullspace ( ). the equations are intentionally singular and kspsetnullspace ( ) was used, but the right hand side is not consistent. you may have to call matnullspaceremove ( ) on the right hand side before calling kspsolve ( ). the equations are indefinite so that standard preconditioners don't work. usually you will know this from the physics, but you can check with - ksp _ compute _ eigenvalues - ksp _ gmres _ restart 1000 - pc _


type none. for simple saddle point problems, try - pc _ type fieldsplit - pc _ fieldsplit _ type schur - pc _ fieldsplit _ detect _ saddle _ point. see the user's manual and pcfieldsplit man page for more details. for more difficult problems, read the literature to find robust methods and ask here ( or petsc - users @ mcs. anl. gov or petsc - maint @ mcs. anl. gov ) if you want advice about how to implement them. for example, see this question for high frequency helmholtz. for modest problem sizes, see if you can live with just using a direct solver. if the method converges in preconditioned residual, but not in true residual, the preconditioner is likely singular or nearly so. this is common for saddle point problems ( e. g. incompressible flow ) or strongly nonsymmetric operators ( e. g. low - mach hyperbolic problems with large time steps ). the preconditioner is too weak or is unstable. see if - pc _ type asm - sub _ pc _ type lu improves the convergence rate. if gmres is losing too much progress in the restart, see if longer restarts help - ksp _ gmres _ restart 300. if a transpose is available, try - ksp _ type bcgs or other methods that do not require a restart. ( note that convergence with these methods is frequently erratic. ) the preconditioning matrix may not be close to the ( possibly unassembled ) operator. try solving with a direct solver, either in serial with - pc _ type lu or in parallel using a third - party package ( e. g. - pc _ type lu - pc _ factor _ mat _ solver _ package superlu _ dist, or mumps ). the method should converge in one iteration if the matrices are the same, and in a " small " number of iterations otherwise. try - snes _ type test to check the matrices if solving a nonlinear problem. the preconditioner is nonlinear ( e. g. a nested iterative solve ), try - ksp _ type fgmres or - ksp _ type gcr. you are using geometric multigrid, but some equations ( often boundary conditions ) are not scaled compatibly between levels. try - pc _ mg _ galerkin to algebraically construct a correctly scaled coarse operator


or make sure that all the equations are scaled in the same way if you want to use rediscretized coarse levels. the matrix is very ill - conditioned. check the condition number using the methods described here. try to improve it by choosing the relative scaling of components / boundary conditions. try - ksp _ diagonal _ scale - ksp _ diagonal _ scale _ fix. perhaps change the formulation of the problem to produce more friendly algebraic equations. if you cannot correct the scaling, you may need to use a direct solver. the matrix is nonlinear ( e. g. evaluated using finite differencing of a nonlinear function ). try different differencing parameters ( e. g. - mat _ mffd _ type ds ). try using higher precision to make the differencing more accurate,. / configure - - with - precision = _ _ float128 - - download - f2cblaslapack. check if it converges in " easier " parameter regimes. a symmetric method is being used for a non - symmetric problem. classical gram - schmidt is becoming unstable, try - ksp _ gmres _ modifiedgramschmidt or use a method that orthogonalizes differently, e. g. - ksp _ type gcr.


first of all, as skillman and dan have pointed out, profiling is essential. i personally use intel's vtune amplifier on linux as it gives me a very fine - grained overview of where time was spent doing what. if you're not going to change the algorithm ( i. e. if there will be no major changes that will turn all your optimizations obsolete ), then i'd suggest looking for some common implementation details that can make a big difference : memory locality : is data that is read / used together also stored together, or are you picking up bits and pieces here and there? memory alignment : are your doubles actually aligned to 4 bytes? how did you pack your structs? to be pedantic, use posix _ memalign instead of malloc. cache efficiency : locality takes care of most cache efficiency issues, but if you have some small data structures that you read / write often, it helps if they are an integer multiple or fraction of a cache line ( usually 64 bytes ). it also helps if your data is aligned to the size of a cache line. this can drastically reduce the number of reads necessary to load a piece of data. vectorization : no, don't go mental with hand - coded assembler. gcc offers vector types that get translated to sse / altivec / whatever instructions automagically. instruction - level parallelism : the bastard son of vectorization. if some often - repeated computation does not vectorize well, you can try accumulating input values and computing several values at once. it's kind of like loop unrolling. what you're exploiting here is that your cpu will usually have more than one floating - point unit per core. arithmetic precision : do you really need double - precision arithmetic in everything you do? e. g. if you're computing a correction in a newton iteration, you usually don't need all the digits you're computing. for a more in - depth discussion, see this paper. some of these tricks are used in the daxpy _ cvec this thread. having said that, if you're using fortran ( not a low - level language in my books ), you will have very little control over most of these " tricks ". if you're running on some dedicated hardware, e. g. a cluster you use for all your production runs, you may also want to read - up on the specifics of the cpus used.


not that you should write stuff in assembler directly for that architecture, but it might inspire you to find some other optimizations that you may have missed. knowing about a feature is a necessary first step to writing code that can exploit it. update it's been a while since i wrote this and i hadn't noticed that it had become such a popular answer. for this reason, i'd like to add one important point : talk to your local computer scientist : wouldn't it be cool if there were a discipline which dealt exclusively with making algorithms and / or computations more efficient / elegant / parallel, and we could all go ask them for advice? well, good news, that discipline exists : computer science. chances are, your institution even has a whole department dedicated to it. talk to these guys. i'm sure to a number of non - computer scientists this will bring back memories of frustrating discussions with said discipline that led to nothing, or memories of other people's anecdotes thereof. don't be discouraged. interdisciplinary collaboration is a tricky thing, and it takes a bit of work, but the rewards can be massive. in my experience, as a computer scientist ( cs ), the trick is in getting both the expectations and the communication right. expectation - wise, a cs will only help you if he / she thinks your problem is interesting. this pretty much excludes trying to optimize / vectorize / parallelize a piece of code you've written, but not really commented, for a problem they don't understand. css are usually more interested in the underlying problem, e. g. the algorithms used to solve it. don't give them your solution, give them your problem. also, be prepared for the cs to say " this problem has already been solved ", and just give you a reference to a paper. a word of advice : read that paper and, if it really does apply to your problem, implement whatever algorithm it suggests. this is not a cs being smug, it's a cs that just helped you. don't be offended, remember : if the problem is not computationally interesting, i. e. it has already been solved and the solution shown to be optimal, they won't work on it, much less code it up for you. communication - wise, remember that most css are not experts in your field, and explain the problem in terms of what you are doing, as opposed to how and why. we usually really


don't care about the why, and the how is, well, what we do best. for example, i'm currently working with a bunch of computational cosmologists on writing a better version of their simulation code, based on sph and multipoles. it took about three meetings to stop talking in terms of dark matter and galaxy haloes ( huh? ) and to drill down to the core of the computation, i. e. that they need to find all the neighbours within a given radius of each particle, compute some quantity over them, and then run over all said neighbours again and apply that quantity in some other computation. then move the particles, or at least some of them, and do it all again. you see, while the former may be incredibly interesting ( it is! ), the latter is what i need to understand to start thinking about algorithms. but i'm diverging from the main point : if you're really interested in making your computation fast, and you're not a computer scientist yourself, go talk to one.


maybe to see the difference between rank 2 tensors and matrices, it is probably best to see a concrete example. actually this is something which back then confused me very much in the linear algebra course ( where we didn't learn about tensors, only about matrices ). as you may know, you can specify a linear transformation $ a $ between vectors by a matrix. let's call that matrix $ a $. now if you do a basis transformation, this can also be written as a linear transformation, so that if the vector in the old basis is $ v $, the vector in the new basis is $ t ^ { - 1 } v $ ( where $ v $ is a column vector ). now you can ask what matrix describes the transformation $ a $ in the new basis. well, it's the matrix $ t ^ { - 1 } at $. well, so far, so good. what i memorized back then is that under basis change a matrix transforms as $ t ^ { - 1 } at $. but then, we learned about quadratic forms. those are calculated using a matrix $ a $ as $ u ^ tav $. still, no problem, until we learned about how to do basis changes. now, suddenly the matrix did not transform as $ t ^ { - 1 } at $, but rather as $ t ^ tat $. which confused me like hell : how could one and the same object transform differently when used in different contexts? well, the solution is : because we are actually talking about different objects! in the first case, we are talking about a tensor that takes vectors to vectors. in the second case, we are talking about a tensor that takes two vectors into a scalar, or equivalently, which takes a vector to a covector. now both tensors have $ n ^ 2 $ components, and therefore it is possible to write those components in a $ n \ times n $ matrix. and since all operations are either linear or bilinear, the normal matrix - matrix and matrix - vector products together with transposition can be used to write the operations of the tensor. only when looking at basis transformations, you see that both are, indeed, not the same, and the course did us ( well, at least me ) a disservice by not telling us that we are really looking at two different objects, and not just at two different uses of the same object, the matrix. indeed, speaking of a rank - 2 tensor is not


really accurate. the rank of a tensor has to be given by two numbers. the vector to vector mapping is given by a rank - ( 1, 1 ) tensor, while the quadratic form is given by a rank - ( 0, 2 ) tensor. there's also the type ( 2, 0 ) which also corresponds to a matrix, but which maps two covectors to a number, and which again transforms differently. the bottom line of this is : the components of a rank - 2 tensor can be written in a matrix. the tensor is not that matrix, because different types of tensors can correspond to the same matrix. the differences between those tensor types are uncovered by the basis transformations ( hence the physicist's definition : " a tensor is what transforms like a tensor " ). of course, another difference between matrices and tensors is that matrices are by definition two - index objects, while tensors can have any rank.


there is no such right triangle. the maximum possible altitude is half the hypotenuse ( inscribe the triangle into a circle to see this ), which here is $ 5 $ inches. you would only get $ 30 $ square inches if you tried to compute the area without checking whether the triangle actually exists.


addition is fast because cpu designers have put in the circuitry needed to make it fast. it does take significantly more gates than bitwise operations, but it is frequent enough that cpu designers have judged it to be worth it. see both can be made fast enough to execute within a single cpu cycle. they're not equally fast - - addition requires more gates and more latency than a bitwise operation - - but it's fast enough that a processor can do it in one clock cycle. there is a per - instruction latency overhead for the instruction decoding and control logic, and the latency for that is significantly larger than the latency to do a bitwise operation, so the difference between the two gets swamped by that overhead. aprogrammer's answer and paul92's answer explain those effects well.


the sampling rate of a real signal needs to be greater than twice the signal bandwidth. audio practically starts at 0 hz, so the highest frequency present in audio recorded at 44. 1 khz is 22. 05 khz ( 22. 05 khz bandwidth ). perfect brickwall filters are mathematically impossible, so we can't just perfectly cut off frequencies above 20 khz. the extra 2 khz is for the roll - off of the filters ; it's " wiggle room " in which the audio can alias due to imperfect filters, but we can't hear it. the specific value of 44. 1 khz was compatible with both pal and ntsc video frame rates used at the time. note that the rationale is published in many places : wikipedia : why 44. 1 khz?


i work with an old toolmaker who also worked as a metrologist who goes on about this all day. it seems to boil down to exploiting symmetries since the only way you can really check something is against itself. squareness : for example, you can check a square by aligning one edge to the center of straight edge and tracing a right angle, then flip it over, re - align to the straight edge while also trying to align to the traced edge as best you can. then trace it out again. they should overlap if the square is truly square. if it's not, there will be an angular deviation. the longer the arms, the more evident smaller errors will be and you can measure the linear deviation at the ends relative to the length of the arms to quantify squareness. other angles : a lot of other angles can be treated as integer divisions of 90 degree angle which you obtained via symmetry. for example, you know two 45 degrees should perfectly fill 90 degrees so you can trace out a 45 degree angle and move it around to make it sure it perfectly fills the remaining half. or split 90 degrees into two and compare the two halves to make sure they match. you can also use knowledge of geometry and form a triangle using fixed lengths with particular ratios to obtain angles, such as the 3 - 4 - 5 triangle. flat surfaces : similarly, you can produce flat surfaces by lapping two surfaces against each other and if you do it properly ( it actually requires three surfaces and is known as the 3 - plate method ), the high points wear away first leaving two surfaces which must be symmetrical, aka flat. in this way, flat - surfaces have a self - referencing method of manufacture. this is supremely important because, as far as i know, they are the only things that do. i started talking about squares first since the symmetry is easier to describe for them, but it is the flatness of surface plates and their self - referencing manufacture that allow you to begin making the physical tools to actually apply the concept of symmetries to make the other measurements. you need straight edges to make squares and you can't make ( or at least, check ) straight edges without flat surface plates, nor can you check if something is round... " roundness " : after you've produced your surface plate, straight edges, and squares using the methods above, then you can check how round something is by rolling it along a surface plate and using a gauge block or indicator to check how much the


height varies as it rolls. edit : as mentioned by a commenter, this only checks diameter and you can have non - circular lobed shapes ( such as those made in centerless grinding and can be nearly imperceptibly non - circular ) where the diameter is constant but the radius is not. checking roundness via radius requires a lot more parts. basically enough to make a lathe and indicators so you can mount the centers and turn it while directly measuring the radius. you can also place it in v - blocks on a surface - plate and measure but the v - block needs to be the correct angle relative to the number of lobes so they seat properly or the measurement will miss them. fortunately lathes are rather basic and simple machinery and make circular shapes to begin with. you don't encounter lobed shapes until you have more advanced machinery like centerless grinders. i suppose you could also place it vertically on a turntable if it has a flat squared end and indicate it and slide it around as you turn it to see if you can't find a location where the radius measures constant all the way around. parallel : you might have asked yourself " why do you need a square to measure roundness above? " the answer is that squares don't just let you check if something is square. they also let you check indirectly check the opposite : whether something is parallel. you need the square to make sure the the gauge block's top and bottom surfaces are parallel to each other so that you can place the gauge block onto the surface plate, then place a straight edge onto the gauge block such that the straight edge runs parallel to the surface plate. only then can you measure the height of the workpiece as it, hopefully, rolls. incidentally, this also requires the straight edge to be square which you can't know without having a square. more on squareness : you can also now measure squareness of a physical object by placing it on a surface plate, and fixing a straight edge with square sides to the side of the workpiece such that the straight edge extends horizontally away from the workpiece and cantilevers over the surface plate. you then measure the difference in height for which the straight edge sits above the surface plate at both ends. the longer the straight edge, the more resolution you have, so long as sagging doesn't become an issue. from these basic measurements ( square, round, flat / straight ), you get all the other mechanical measurements. the inherent symmetries which enable


self - checking are what makes " straight ", " flat ", " round ", and " square " special. it's why we use these properties and not random arcs, polygons, or angles as references when calibrating stuff. actually making stuff rather than just measuring : up until now i mainly talked about measurement. the only manufacturing i spoke about was the surface plate and its very important self - referencing nature which allows it to make itself. that's because so long as you have a way to make that first reference from which other references derive, you can very painstakingly free - hand workpieces and keep measuring until you get it straight, round or square. after which you can use the result to more easily make other things. just think about free - hand filing a round and straight hole in a wood wagon wheel, and then free - hand filing a round and straight axle. it makes my brain glaze over too. it'd also be a waste since you would be much better off doing that for parts of a lathe which could be used to make more lathes and wagon wheels. it's tough enough to file a piece of steel into a square cube with file that is actually straight, let alone a not - so - straight file which they probably didn't always have in the past. but so long as you have a square to check it with, you just keep correcting it until you get it. it is apparently a common apprentice toolmaker task to teach one how to use a file. spheres : to make a sphere you can start with a stick fixed at one end to draw an arc. then you put some stock onto a lathe and then lathe out that arc. then you take that work piece and turn it 90 degrees and put it back in the lathe using a special fixture and then lathe out another arc. that gives you a sphere - like thing. i don't know how sphericity is measured especially when lobed shapes exist ( maybe you seat them in a ring like the end of a hollow tube and measure? ). or how really accurate spheres, especially gauge spheres, are made. it's secret, apparently. edit : someone mentioned putting molten material into freefall and allow surface tension to pull it into a sphere and have it cool on the way down. would work for low tech production of smaller spheres production and if you could control material volume as it was dropped you can control size. still not sure how precisely manufactured spheres are


made though or how they are ground. there doesn't seem to be an obvious way to use spheres to make more spheres unlike the other things.


graphviz should work. i believe that the images associated with the matrices in the university of florida sparse matrix collection were visualized using sfdp, a force - directed graph visualization algorithm developed by yifan hu. most of the matrices in the collection have a computational time associated with generating a corresponding visualization, so you might be able to search for matrices whose graphs have characteristics similar to the ones you wish to visualize. for instance, a graph with ~ 2. 1 million nodes and ~ 3 million edges took hu ~ 36000s to generate, or 10 hours. while it's not clear what hardware was used to generate the graph, it's probably a reasonable guess that a desktop or laptop was used, and the times would at least give you a rough idea of how much time rendering the graph may take. hu's algorithm appears to be one of the state - of - the - art visualization algorithms ( he published it in 2005 ), but not being an expert in the field, i can't speak to whether or not better algorithms exist. this algorithm is included with graphviz as an option, and is designed to be used on large graphs such as the one you describe.


your teacher was right. current is electric charges ( usually electrons ) moving. they don't do that by themselves for no reason, no more so than a shopping cart moves across the floor of a store by itself. in physics, we call the force that pushes charges the electromotive force, or " emf ". it is almost always expressed in units of volts, so we usually take little shortcut and say " voltage " most of the time. technically emf is the physical quantity and volts is one unit it can be quantified in. emf can be generated several ways : electromagnetic. when a conductor ( like a wire ) is moved sideways thru a magnetic field, there will be a voltage generated along the length of the wire. electric generators like in power plants and the alternator in your car work on this principle. electrochemical. a chemical reaction can cause a voltage difference. batteries work on this principle. photovoltaic. crash photons into a semiconductor diode at the right place and you get a voltage. this is how solar cells work. electrostatic. rub two of the right kind of materials together and one sheds electrons onto the other. two material that exhibit this phenomenon well are a plastic comb and a cat. this is what happens when you shuffle across the right kind of carpet and then get a zap when you touch a metal object. rubbing a balloon against your shirt does this, which then allows the balloon to " stick " to something else. in that case the emf can't make the electrons move, but it still pulls on them, which then in turn pull on the baloon they are stuck on. this effect can be scaled up to make vary high voltages and is the basis for how van de graaff generators work. thermo - electric. a temperature gradient along most conductors causes a voltage. this is called the siebeck effect. unfortunately you can't harness that because to use this voltage there is eventually a closed loop. any voltage gained by a temperature rise in part of the loop is then offset by a temperature decrease in another part of the loop. the trick is to use two different materials that exhibit a different voltage as a result of the same temperature gradient ( different siebeck coefficient ). use one material going out to a heat source and a different coming back, and you do get a net voltage you can use at the same temperature. the total voltage you get from one out and back, even with a high temperature difference is pretty


small. by putting many of these out and back combinations together, you can get a useful voltage. a single out and back is called a thermocouple, and can be used to sense temperature. many together is a thermocouple generator. yes, those actually exist. there have been spacecraft powered on this principle with the heat source coming from the decay of a radio - isotope. thermionic. if you heat something high enough ( 100s of °c ), then the electrons on its surface move so fast that sometimes they fly off. if they have a place to land that is colder ( so they won't fly off again from there ), you have a thermionic generator. this may sound far fetched, but there have also been spacecraft powered from this principle with the heat source again being radio - isotope decay. electron tubes use this principle in part. instead of heating something so that electrons fly off on their own, you can heat it to almost that point so that they fly off when a little extra voltage is applied. this is the basis of the vacuum tube diode and important to most vacuum tubes. this is why these tubes had heaters and you could see them glow. it takes glowing temperatures to get to where the thermionic effect is significant. piezo - electric. certain materials ( quartz crystal for example ) generate a voltage when you squeeze them. some microphones work on this principle. the varying pressure waves in the air we call sound squish and squash a quartz crystal alternately, which causes it to make tiny voltage waves as a result. we can amplify them to eventually make signals you can record, drive loudspeakers with so you can hear them, etc. this principle is also used in many barbecue grill igniters. a spring mechanism whacks a quartz crystal pretty hard so that it makes enough of a voltage to cause a spark.


according to martin chaplin's water dissociation and ph : in ice, where the local hydrogen bonding rarely breaks to separate the constantly forming and re - associating ions, the dissociation constant is much lower ( for example at $ - 4 ~ \ mathrm { ^ \ circ c } $, $ k _ \ mathrm { w } = 2 \ times 10 ^ { - 20 } ~ \ mathrm { mol ^ 2 ~ l ^ { - 2 } } $ ). so $ [ \ ce { h + } ] = 1. 4 \ times 10 ^ { - 10 } ~ \ mathrm { mol \ l ^ { - 1 } } \ longrightarrow \ mathrm { p [ \ ce { h + } ] } = 9. 9 $ for more information see self - dissociation and protonic charge transport in water and ice proceedings of the royal society of london. series a, mathematical and physical sciences vol. 247, no. 1251 ( oct. 21, 1958 ), pp. 505 - 533 this is a review article by nobel prize winner manfred eigen, after whom hydrated $ \ ce { h3o + } $ is sometimes referred to as the eigen ion.


i always though that $ \ mu $ - recursive functions nailed it. here is what defines the whole set of computable functions ; it is the smallest set of functions containing resp. closed against : the constant $ 0 $ function the successor function selecting parameters function composition primitive recursion the $ \ mu $ - operator ( look for the smallest $ x $ such that... ) check above link for details ; you see that it makes for a very compact programming language. it is also horrible to program in - - no free lunch. if you drop any of those, you will lose full power, so it is a minimal set of axioms. you can translate those quite literally into basic syntactical elements for while programs, namely the constant 0 incrementation _ + 1 variable access x program / statement concatenation _ ; _ countdown loops for ( x to 0 ) do _ end while loops while ( x! = 0 ) do _ end


there exist problems that are hard to solve, but for which it is easy to verify the validity of a given solution : the so called np problems. this statement is wrong. there are many np problems which are easy to solve. " np " simply means " easy to verify ". it does not mean hard to solve. what you are probably thinking of is np - complete problems which is a subset of the np problems for which we have very, very good evidence to think they are hard. however, quantum computers are not expected to be able to solve np - complete problems significantly more " easily " than regular computers. factoring is also thought to be hard, but the evidence for this is only " very good " and not " very, very good " ( in other words : factoring is likely not np - complete ). factoring is one of very few natural problems which falls in between not being np - complete and not being easy. the list of problems that we know that are easy to verify, easy to solve on a quantum computer but hard classicly, is even shorter. in fact, i do not know of any problem other than factoring ( and the very closely related discrete logarithm problem ) with this property. moreover, any easy to verify problem would likely have the same issue as factoring : $ 53 $ qubits is not that many, and $ 2 ^ { 53 } $ is huge, but just within reach of classical computing. $ 2 ^ { 53 } $ less than $ 10 ^ { 16 } $, and most classical computers can execute on the order of $ 10 ^ 9 $ operations per second. we could run through all possibilities in about $ 1 / 3 $ rd of a year on a single classical desktop computer. quantum computers have very few applications which they're known to be good at, and are essentially useless for most hard np problems.


just ask her what the voltage across the resistor is


i have thought about this some more, and think that the following should be fairly stable. note that i have limited myself to morphological operations, because these should be available in any standard image processing library. ( 1 ) open image with a npix - by - 1 mask, where npix is about the vertical distance between letters # % read image img = rgb2gray ('% # threshold and open with a rectangle % # that is roughly letter sized bwimg = img > 200 ; % # threshold of 200 is better than 128 opimg = imopen ( bwimg, ones ( 13, 1 ) ) ; ( 2 ) open image with a 1 - by - mpix mask to eliminate whatever is too narrow to be a river. opimg = imopen ( opimg, ones ( 1, 5 ) ) ; ( 3 ) remove horizontal " rivers and lakes " that are due to space between paragraphs, or indentation. for this, we remove all rows that are all true, and open with the npix - by - 1 mask that we know will not affect the rivers we have found previously. to remove lakes, we can use an opening mask that is slightly larger than npix - by - npix. at this step, we can also throw out everything that is too small to be a real river, i. e. everything that covers less area than ( npix + 2 ) * ( mpix + 2 ) * 4 ( that will give us ~ 3 lines ). the + 2 is there because we know that all objects are at least npix in height, and mpix in width, and we want to go a little above that. % # horizontal river : just look for rows that are all true opimg ( all ( opimg, 2 ), : ) = false ; % # open with line spacing ( npix ) opimg = imopen ( opimg, ones ( 13, 1 ) ) ; % # remove lakes with npix + 2 opimg = opimg & ~ imopen ( opimg, ones ( 15, 15 ) ) ; % # remove small fry opimg = bwareaopen ( opimg, 7 * 15 * 4 ) ; ( 4 ) if we're interested in not only the length, but also the width of the river, we can combine distance transform with skeleton. dt = bwdist ( ~ opimg ) ; sk = b


##wmorph ( opimg,'skel ', inf ) ; % # prune the skeleton a bit to remove branches sk = bwmorph ( sk,'spur ', 7 ) ; riverswithwidth = dt. * sk ; ( colors correspond to width of river ( though color bar is off by a factor of 2 ) now you can get the approximate length of the rivers by counting the number of pixels in each connected component, and the average width by averaging their pixel values. here's the exact same analysis applied to the second, " no - river " image :


is this a valid way of introducing speed estimates into the process? if you choose your state appropriately, then the speed estimates come " for free ". see the derivation of the signal model below ( for the simple 1 - d case we've been looking at ). signal model, take 2 so, we really need to agree on a signal model before we can move this forward. from your edit, it looks like your model of the position, $ x _ k $, is : $ $ \ begin { array } xx _ { k + 1 } & = & x _ { k } + \ dot { x } _ { k } \ delta t + \ frac { 1 } { 2 } a ( \ delta t ) ^ 2 \ \ \ dot { x } _ { k + 1 } & = & \ dot { x } _ { k } + a \ delta t \ end { array } $ $ if our state is as before : $ $ \ begin { align * } \ mathbf { x } _ { k } & = \ left ( \ begin { array } [ c ] { c } x _ { k } \ \ \ dot { x } _ { k } \ end { array } \ right ) \ end { align * } $ $ then the state update equation is just : $ $ \ mathbf { x } _ { k + 1 } = \ left ( \ begin { array } [ c ] { c } 1 \ \ \ delta t \ \ 0 \ \ 1 \ end { array } \ right ) \ mathbf { x } _ { k } + \ left ( \ begin { array } [ c ] { c } \ frac { ( \ delta t ) ^ 2 } { 2 } \ \ \ delta t \ end { array } \ right ) a _ k $ $ where now our $ a _ k $ is the normally distributed acceleration. that gives different $ \ mathbf { g } $ matrix from the previous version, but the $ \ mathbf { f } $ and $ \ mathbf { h } $ matrices should be the same. if i implement this in scilab ( sorry, no access to matlab ), it looks like : / / signal model deltat = 0. 1 ; f = [ 1 deltat ; 0 1 ] ; g = [ deltat ^ 2 / 2 ; deltat ] ; h = [ 1 0 ] ; x0 = [ 0 ; 0 ] ; sigma _ a = 0. 1


; q = sigma _ a ^ 2 ; r = 0. 1 ; n = 1000 ; a = rand ( 1, n, " normal " ) * sigma _ a ; x _ truth ( :, 1 ) = x0 ; for t = 1 : n, x _ truth ( :, t + 1 ) = f * x _ truth ( :, t ) + g * a ( t ) ; y ( t ) = h * x _ truth ( :, t ) + rand ( 1, 1, " normal " ) * sqrt ( r ) ; end then, i can apply the kalman filter equations to this $ y $ ( the noisy measurements ). / / kalman filter p0 = 100 * eye ( 2, 2 ) ; xx ( :, 1 ) = x0 ; pp = p0 ; pp _ norm ( 1 ) = norm ( pp ) ; for t = 1 : n, [ x1, p1, x, p ] = kalm ( y ( t ), xx ( :, t ), pp, f, g, h, q, r ) ; xx ( :, t + 1 ) = x1 ; pp = p1 ; pp _ norm ( t + 1 ) = norm ( pp ) ; end so we have our noisy measurements $ y $, and we've applied the kalman filter to them and used the same signal model to generate $ y $ as we do to apply the kalman filter ( a pretty big assumption, sometimes! ). then following plots show the result. plot 1 : $ y $ and $ x _ k $ versus time. plot 2 : a zoomed view of the first few samples : plot 3 : something you never get in real life, the true position vs the state estimate of the position. plot 4 : something you also never get in real life, the true velocity vs the state estimate of the velocity. plot 5 : the norm of the state covariance matrix ( something you should always monitor in real life! ). note that it very quickly goes from its initial very large value to something very small, so i've only shown the first few samples. plot 6 : plots of the error between the true position and velocity and their estimates. if you study the case where the position measurements are exact, then you find that the kalman udpate equations produce exact results for both position and speed. mathematically it's straightforward to see why. using the same notation as the wikipedia article,


exact measurements mean that $ \ mathbf { z } _ { k + 1 } = x _ { k + 1 } $. if you assume that the initial position and speed are known so that $ \ mathbf { p } _ k = 0 $, then $ \ mathbf { p } _ { k + 1 } ^ { - } = \ mathbf { q } $ and the kalman gain matrix $ \ mathbf { k } _ { k + 1 } $ is given by $ $ \ mathbf { k } _ { k + 1 } = \ left ( \ begin { array } [ c ] { c } 1 \ \ 2 / dt \ end { array } \ right ) $ $ this means that the kalman update procedure produces $ $ \ begin { align * } \ mathbf { \ hat { x } } _ { k + 1 } & = \ mathbf { f } _ { k + 1 } \ mathbf { x } _ k + \ mathbf { k } _ { k + 1 } \ left ( \ mathbf { z } _ { k + 1 } - \ mathbf { h } _ { k + 1 } \ mathbf { f } _ { k + 1 } \ mathbf { x } _ k \ right ) \ \ & = \ left ( \ begin { array } [ c ] { c } x _ k + \ dot { x } _ k dt \ \ \ dot { x } _ k \ end { array } \ right ) + \ left ( \ begin { array } [ c ] { c } 1 \ \ 2 / dt \ end { array } \ right ) \ left ( x _ { k + 1 } - \ left ( x _ k + \ dot { x } _ k dt \ right ) \ right ) \ \ & = \ left ( \ begin { array } [ c ] { c } x _ { k + 1 } \ \ 2 \ left ( x _ { k + 1 } - x _ k \ right ) / dt - \ dot { x } _ k \ end { array } \ right ) \ end { align * } $ $ as you can see, the value for the speed is given by exactly the formula you were proposing to use for the speed estimate. so although you couldn't see any kind of calculation $ ( x _ k - x _ { k - 1 } ) / dt $ for speed, in fact it is hidden in there after all.


here is the plyr one line variant using ddply : dt < - data. frame ( age = rchisq ( 20, 10 ), group = sample ( 1 : 2, 20, rep = t ) ) ddply ( dt, ~ group, summarise, mean = mean ( age ), sd = sd ( age ) ) here is another one line variant using new package data. table. dtf < - data. frame ( age = rchisq ( 100000, 10 ), group = factor ( sample ( 1 : 10, 100000, rep = t ) ) ) dt < - data. table ( dtf ) dt [, list ( mean = mean ( age ), sd = sd ( age ) ), by = group ] this one is faster, though this is noticeable only on table with 100k rows. timings on my macbook pro with 2. 53 ghz core 2 duo processor and r 2. 11. 1 : > system. time ( aa < - ddply ( dtf, ~ group, summarise, mean = mean ( age ), sd = sd ( age ) ) ) utilisateur systeme ecoule 0. 513 0. 180 0. 692 > system. time ( aa < - dt [, list ( mean = mean ( age ), sd = sd ( age ) ), by = group ] ) utilisateur systeme ecoule 0. 087 0. 018 0. 103 further savings are possible if we use setkey : > setkey ( dt, group ) > system. time ( dt [, list ( mean = mean ( age ), sd = sd ( age ) ), by = group ] ) utilisateur systeme ecoule 0. 040 0. 007 0. 048


yes, deconvolution. this page describes a number of deconvolution methods and methods for estimating the point spread function : removing motion blur from astrophotographic images they say the deconvolution literature is " extremely extensive ". they choose lucy - richardson algorithm for deconvolution and develop their own motion estimation algorithm for determining the point spread function.


tl ; dr : there is a dearth of actual experimental evidence. however : there is at least one study that confirmed the process ( [ study # 7 ] - myxococcus xanthus ; by fiegna and velicer, 2003 ). another study experimentally confirmed higher extinction risk as well ( [ study # 8 ] - paul f. doherty's study of dimorphic bird species an [ study # 9 ] - denson k. mclain ). theoretical studies produce somewhat unsettled results - some models support the evolutionary suicide and some models do not - the major difference seems to be variability of environmental pressures. also, if you include human predation based solely on sexually selected trait, examples definitely exist, e. g. arabian oryx first of all, this may be cheating but one example is the extinction because a predator species specifically selects the species because of selected - for feature. the most obvious case is when the predator species is human. as a random example, arabian oryx was nearly hunted to extinction specifically because of their horns. please note that this is not a simple question - for example, the often - cited in unscientific literature example of irish elk that supposedly went extinct due to its antler size may not be a good crystal - clear example. for a very thorough analysis, see : " sexy to die for? sexual selection and risk of extinction " by hanna kokko and robert brooks, ann. zool. fennici 40 : 207 - 219. [ study # 1 ] they specifically find that evolutionary " suicide " is unlikely in deterministic environments, at least if the costs of the feature are borne by the individual organism itself. another study resulting in a negative result was " sexual selection and the risk of extinction in mammals ", edward h. morrow and claudia fricke ; the royal society proceedings : biological sciences, published online 4 november 2004, pp 2395 - 2401 [ study # 2 ] the aim of this study was therefore to examine whether the level of sexual selection ( measured as residual testes mass and sexual size dimorphism ) was related to the risk of extinction that mammals are currently experiencing. we found no evidence for a relationship between these factors, although our analyses may have been confounded by the possible dominating effect of contemporary anthropogenic factors. however, if one takes into consideration changes in the environment, the extinction becomes theoretically possible. from " runaway evolution to self - extinction under asymmetrical competition " - hiroyuki mats


##uda and peter a. abrams ; evolution vol. 48, no. 6 ( dec., 1994 ), pp. 1764 - 1772 : [ study # 3 ] we show that purely intraspecific competition can cause evolution of extreme competitive abilities that ultimately result in extinction, without any influence from other species. the only change in the model required for this outcome is the assumption of a nonnormal distribution of resources of different sizes measured on a logarithmic scale. this suggests that taxon cycles, if they exist, may be driven by within - rather than between - species competition. self - extinction does not occur when the advantage conferred by a large value of the competitive trait ( e. g., size ) is relatively small, or when the carrying capacity decreases at a comparatively rapid rate with increases in trait value. the evidence regarding these assumptions is discussed. the results suggest a need for more data on resource distributions and size - advantage in order to understand the evolution of competitive traits such as body size. as far as supporting evidence, some studies are listed in " can adaptation lead to extinction? " by daniel j. rankin and andre´s lo´pez - sepulcre, oicos 111 : 3 ( 2005 ). [ study # 4 ] they cite 3 : the first example is a study on the japanese medaka fish oryzias latipes ( muir and howard 1999 - [ study # 5 ] ). transgenic males which had been modified to include a salmon growth - hormone gene are larger than their wild - type counterparts, although their offspring have a lower fecundity ( muir and howard 1999 ). females prefer to mate with larger males, giving the larger transgenic males a fitness advantage over wild - type males. however, offspring produced with transgenic males have a lower fecundity, and hence average female fecundity will decrease. as long as females preferentially mate with larger males, the population density will decline. models of this system have predicted that, if the transgenic fish were released into a wild - type population, the transgene would spread due to its mating advantage over wild - type males, and the population would become go extinct ( muir and howard 1999 ). a recent extension of the model has shown that alternative mating tactics by wild - type males could reduce the rate of transgene spread, but that this is still not sufficient to prevent population extinction ( howard et al. 2004 ). although evolutionary suicide was predicted from extrapolation, rather than observed in nature