egg|nomz|egg changed the topic of #kspacademia to: https://gist.github.com/pdn4kd/164b9b85435d87afbec0c3a7e69d3e6d | Dogs are cats. Spiders are cat interferometers. | Космизм сегодня! | Document well, for tomorrow you may get mauled by a ネコバス. | <UmbralRaptor> egg|nomz|egg: generally if your eyes are dewing over, that's not the weather. | <ferram4> I shall beat my problems to death with an engineer.
<egg>
bofh: it was also my first time trying those automated immigration thingies where you show your passport to a machine rather than a human, both in lhr and back in zrh (no schengen in gb), it was impressive how much they fucked it up in lhr compared to how well it worked in zrh
<egg>
bofh: in lhr they somehow had ~2 machines working at once if you were lucky, sometimes none for a while, the machines took ages to reset, and there were a couple of people pointing you to the machines that had decided to work
<egg>
(in zrh they all worked and I went through without any issues)
<egg>
why am i not asleep
<bofh>
I mean that's exactly the sort of kwality I expect from LHR.
<egg>
bofh: of course this meant you were queueing in front of machines that were permanently off and then pointed haphazardly to a machine at the other end that had decided to work (to which you were beaten by those who were queuing in front of it)
<egg>
!choose sleep|cube roots|complain about the delivery of the wrong grade of copper
<Qboid>
egg: Your options are: sleep, cube roots, complain about the delivery of the wrong grade of copper. My choice: cube roots
<egg>
;choose sleep|cube roots|complain about the delivery of the wrong grade of copper
<kmath>
egg: complain about the delivery of the wrong grade of copper
<egg>
bofh: did zethar manage to make sense of my second message btw
<kmath>
<stephentyrone> Star Wars, but every R2D2 line is replaced with a line from Shinji Ikari. ⏎ ⏎ I am so here for crippling-self-doubt-R2. https://t.co/tBXhZnp4Ya
<SnoopJeDi>
bofh, so we can *mostly* treat the corrections turn-by-turn. There are 4 cavities and the RF phase is what we want to optimize. There are 6 dipole field adjustments that can be set (within some small range) that adjust path-length and thus alter some of those RF phases by changing the arrival time.
<SnoopJeDi>
My supervisor's approach for doing this in his tracker/optimization routines is to adjust each corrector in sequence and record the respective phases, giving one column of a 4x6 to be "inverted" to find the best setting for those 6 that gives the desired phases in those 4 locations
<SnoopJeDi>
It's quite possible there's a better solution, I know for a fact he has to iterate this a few times to get a decent answer, and it's very clearly not independent
<SnoopJeDi>
The odds that I automate anything in this week are pretty lousy anyhow, but I figured I'd ask all the smartest optimization people I know, i.e. this channel, for pointers on that
<bofh>
okay, so you want to optimize overall phase, or phase at each cavity, or?
<bofh>
this is obviously a second-order cone problem, but I honestly think for a system like this, constrained least-squares is good enough.
<whitequark>
cone problem
<whitequark>
are these problems that can be solved by application of cone snails
<UmbralRaptop>
"Conotoxin-γ is notable for its unusually high Lorentz factor…"
<SnoopJeDi>
bofh, yea QR was what I was intending on doing since numpy has an off the shelf implementation.
<SnoopJeDi>
We're looking to optimize the phase for every cavity crossing (isochronocity, ideally), so you can look at it as a (16*4)x(16*6) too, but that'd be a lot more sparse
<SnoopJeDi>
since the path-length changes are totally localized, *most* of the correctors affect the next crossing or two after them
armed_troop has quit [Ping timeout: 198 seconds]
<bofh>
SnoopJeDi: I mean most optimization problems give you sparse matrices, this is what I'd expect :P
<bofh>
but like a 64x96 matrix objective function is honestly tiny tbqh, to the point where brute-force style solutions like yours work quite well.
armed_troop has joined #kspacademia
<SnoopJeDi>
yea, agreed
<SnoopJeDi>
building that matrix is expensive-ish though
<SnoopJeDi>
it's not expensive by traditional optimization problem rulers, but eugh
<bofh>
Yeah I somehow get the feeling that evaluation of your objective function dwarfs actually any sort of gradient descent/quasi-Newton search, which is... kind of a nasty place to be, honestly.
<SnoopJeDi>
yep
<SnoopJeDi>
it's not bad for traditional transport codes where you're "just" concatenating a whole bunch of beamline elements, because that's a bunch of matrix multiplications
<SnoopJeDi>
but the "rolled-up linac" nature of this means that every evaluation of an objective function is a Runge-Kutta run :/
<SnoopJeDi>
in lieu of some more clever analytical treatment that hasn't appeared to us shy of "uh Alex Dragt has some interesting ideas about using Lie operators"
<SnoopJeDi>
but even in e.g. MAD-X (LHC's optics) the optimization isn't all that sophisticated: usually jacobian, sometimes simplex if something is reaaaally finicky
<bofh>
Yeah I'd do exactly that (except I much prefer interior-point to simplex, but yeah).
<SnoopJeDi>
so the nice thing about my supervisor's work is that since he wrote the whole thing, he can unwind his tracker to a suitable state and track a lot less. The off-the-shelf one we're trying to migrate into allegedly has run resume, but uh it super does not work
<bofh>
Except in this case not really b/c a Runge-Kutta run per gradient computation is *really* expensive.
<bofh>
rofl
<bofh>
Of course it doesn't, it's commercial academic code.
<SnoopJeDi>
idk, we'll see. I have a skeleton for how to do the runs iteratively already done up so
<SnoopJeDi>
oh it's not commercial, thankfully :P
<bofh>
Excellent, keep me posted.
<SnoopJeDi>
but the second pejorative definitely applies
<SnoopJeDi>
thanks for kicking it around a bit :)
<egg|zzz|egg>
!wpn bofh, UmbralRaptop, whitequark, et al.
* Qboid
gives bofh, UmbralRaptop, whitequark, et al. a long expression
<egg|zzz|egg>
!u 𒀉
<Qboid>
U+12009 CUNEIFORM SIGN A2 (𒀉)
<UmbralRaptop>
!wpn egg|zzz|egg
* Qboid
gives egg|zzz|egg a global explosive brachistochrone
<kmath>
<stephentyrone> @volatile_void @johnregehr This is the earliest such precedent I know of for avoiding double-rounding, but I'm sure… https://t.co/e6UoO9AirV
<kmath>
<ManishEarth> @KhaledGhetas @zwnj @Gankro Traditional Mongolian: *bursts in through the wall like then Kool-Aid Man* ⏎ ⏎ Me: NOPEnopeNOPEnope
<egg|zzz|egg>
!seen hattivat
<Qboid>
egg|zzz|egg: I haven't seen the user hattivat yet.
<iximeow>
achievement of the day: kicked out of an empty parking lot at 3:30am
<UmbralRaptop>
o_O
<iximeow>
there was good line of sight for saturn! there weren't trees everywhere!
<UmbralRaptop>
Next time try a park?
<iximeow>
there aren't really any nearby that aren't also full of problematic trees
<UmbralRaptop>
Sure, trees emit a highly corrosive gas when exposed to sunlight, but problematic?
<UmbralRaptop>
More seriously, I'm assuming large fields that mean the trees are at low angles.
<iximeow>
those are in short supply
<egg|zzz|egg>
!wpn iximeow
* Qboid
gives iximeow a copy-on-write octopus which vaguely resembles a DDOS
<egg|zzz|egg>
!wpn котя
* Qboid
gives котя a Stern-Gerlach sigma matrix/🔫 hybrid
UmbralRaptop has quit [Ping timeout: 186 seconds]
<egg|zzz|egg>
!wpn the котяchrome kitten
* Qboid
gives the котяchrome kitten an involutory oscillator
<whitequark>
!wpn egg
* Qboid
gives egg a tellurium espresso with a float attachment
<whitequark>
the worst espresso
<whitequark>
ok i guess thallium espresso would be worse
<whitequark>
!wpn -add:adj thallium
<Qboid>
whitequark: Adjective already added!
<whitequark>
!wpn -add:adj polonium
<Qboid>
whitequark: Adjective already added!
<whitequark>
...
<egg|zzz|egg>
whitequark: I think umbralraptor added them all :-p
UmbralRaptop has joined #kspacademia
Qboid was kicked from #kspacademia by *status [You have been disconnected from the IRC server]
Qboid has joined #kspacademia
egg|zzz|egg has quit [Ping timeout: 186 seconds]
whitequark has quit [Ping timeout: 186 seconds]
whitequark has joined #kspacademia
oeuf is now known as egg
<egg>
hm
<egg>
not sure if my preceding message went through, at least it's not in the logs
<egg>
bofh: so I think I have a proof for a max. relative error of 0.50022 * 2^-52 for the Halley variant of the egg method, so that the max error would be in [0.50005, 0.50022] ULPs
<UmbralRaptop>
So, today is Earth Day. Effectively in the same sense as those Infrastructure Weeks?
<egg>
!wpn B787_300
* Qboid
gives B787_300 an involutory rotation
<egg>
!wpn bofh
* Qboid
gives bofh an Abelian grammar which vaguely resembles a counter
<egg>
!wpn UmbralRaptop
* Qboid
gives UmbralRaptop a C# patent
* B787_300
spins around
* UmbralRaptop
sues Microsoft in much the same way Oracle is suing IBM.
<whitequark>
!wpn UmbralRaptop
* Qboid
gives UmbralRaptop an imaginary স্রু
<whitequark>
!wpn egg
* Qboid
gives egg a polonium function generator
<whitequark>
"Hornery"
<SnoopJeDi>
bofh, oh my god so we had a project meeting this morning since we're so under the gun, and as we wrapped up, my supervisor told me a story about when he was a grad student working in nuclear...
<SnoopJeDi>
He needed to do many quadratures on functions with unpredictable logarithmic singularities, but the systems he was using only had 8 (or maybe 16?) bits of precision available. Not enough, at any rate
<SnoopJeDi>
So he wrote his own decimal representation in "registers" that gave him the precision he desired, but then he couldn't rely on the system implementations of functions like lg() or tan()
<SnoopJeDi>
so uh he wrote those too. dude's apparently seen some shit in the computational world
<SnoopJeDi>
Maybe that was more common once upon a time, but egads!
<SnoopJeDi>
(if I understood him correctly which is usually a coin-flip, the main issue was Gram-Schmidt construction of orthogonal polynomials and the omnipresent problem of floating point subtraction)
<whitequark>
subtraction?
<whitequark>
is that hard?
<egg>
whitequark: if it cancels and its inputs have rounding errors it can kill all the bits
<SnoopJeDi>
AIUI it's not hard if you've got bits to spare for guarding? Bear in mind, this is 40-50 years ago
<SnoopJeDi>
and since he was doing a round of Gram-Schmidt for each next polynomial order, any precision problem snowballed really fast
<SnoopJeDi>
egg, I told him about Principia during the same conversation, actually
<whitequark>
egg: all the bits?
<SnoopJeDi>
well, mostly about your generalized FISR thing (right?) and how I gawk at y'all constructing an algorithm, but Principia got name-dropped too
<whitequark>
oh you mean like the entire mantissa becomes junk?
<SnoopJeDi>
yea, IIRC for two values who agree to N places you can lose N bits of precision?
<SnoopJeDi>
probably mangling that idea though, I don't grok floating-point that well
<egg>
SnoopJeDi: if you have errors on the input though, otherwise it's really the reverse, the result is exact :D
<SnoopJeDi>
yea and the "up to" is a worst-case, right?
<egg>
whitequark: or rather it becomes junk followed by 0s
<egg>
SnoopJeDi: FISR?
<egg>
FISR?
<Qboid>
egg: [FISR] => Fast inverse square root
<egg>
ah
<SnoopJeDi>
I think it's a very uncommon abbreviation, I'm just lazy
<SnoopJeDi>
and idk if you've given your project any name?
<egg>
SnoopJeDi: which project
<egg>
Principia?
<SnoopJeDi>
uh you're generalizing inverse square root for N dimensions, is that right? very probably I've misunderstood
<SnoopJeDi>
I'm only tangentially aware of it, really
<SnoopJeDi>
and it also seems like maybe it's one little slice of something you're putting into Principia
<egg>
SnoopJeDi: for N other than -2
<SnoopJeDi>
oh, derp
<egg>
SnoopJeDi: because we have an nth root which realistically only needs one significant digit somewhere, so a proper rootn would be overkill (as well as nonexistent but hopefully I can do something about that)
<egg>
s/si.*git/sig. dec./
<Qboid>
egg meant to say: SnoopJeDi: because we have an nth root which realistically only needs one sig. dec. somewhere, so a proper rootn would be overkill (as well as nonexistent but hopefully I can do something about that)
<egg>
SnoopJeDi: also I somehow got sidetracked into writing a cbrt
<egg>
SnoopJeDi: I mean tbh the main reason for that foray into roots was that I was bored because I had the flu
<SnoopJeDi>
so the inverse rootn is for Principia, then?
<egg>
yeah
<SnoopJeDi>
neato
<SnoopJeDi>
thanks for clearing that up
<egg>
and I mean we use cbrt in principia too in the Kepler stuff so we could use it there
<SnoopJeDi>
yea ofc
<egg>
SnoopJeDi: non-inverse rootn too btw
<egg>
tbh the Kepler stuff is an endless source of horrible numerics trickery
<egg>
everything is ill-conditioned
<SnoopJeDi>
I'm not sure what "the Kepler stuff" is but "endless source of horrible numerics trickery" is pretty much #kspacademia :P
<bofh>
SnoopJeDi: Gram-Schmidt is known to be horrendously numerically unstable, there's a reason it's avoided snd alternatives used whenever possible (which, sadly, sometimes isn't possible).
<egg>
an endless supply of code paths, each with worse condition numbers than the last
<SnoopJeDi>
oh, representing things in terms of Keplerian orbits?
<bofh>
egg: accurate
<egg>
bofh: so like if I want to handle ill-conditioning properly I need even more code paths
<SnoopJeDi>
bofh, difficult to tell whether it was or wasn't necessary for him, but given that he's bold enough to tackle challenges like...that...I usually trust his judgement
<SnoopJeDi>
I'm glad I can just instruct scipy to do the QR decomposition for me though :)
<SnoopJeDi>
I make enough mistakes writing nice abstracted stuff, I'd be a bull in a china shop down there in numerics land.
<egg>
SnoopJeDi: but you can do both with principia! insane abstractions and fancy numerics :D
<kmath>
<eggleroy> Some more ∛ fun (thanks to @bofh453 for translating FNLIB’s DCBRT for the purposes of this comparison). ⏎ The “egg (H… https://t.co/IEJDa2RZEv
<egg>
bofh: hmmm, [0.50010, 0.50023ish] (but I'm worried about cancellations in the polynomial increasing that 0.50023ish, it also makes the analysis harder :-p)
<kmath>
<eggleroy> Some more ∛ fun (thanks to @bofh453 for translating FNLIB’s DCBRT for the purposes of this comparison). ⏎ The “egg (H… https://t.co/IEJDa2RZEv
<egg>
SnoopJeDi: which "up to"
<egg>
in <SnoopJeDi> yea and the "up to" is a worst-case, right?
<kmath>
<Wervus> Shout out to my cat for being the best pencil case ever https://t.co/cO0Xu6U958
<egg>
!wpn bofh
* Qboid
gives bofh a verbose alternator
<egg>
meow
<iximeow>
meow
APlayer has joined #kspacademia
<whitequark>
meow
* APlayer
pets whitequark
UmbralRaptor has joined #kspacademia
UmbralRaptop has quit [Ping timeout: 186 seconds]
* UmbralRaptor
🔪 numpy of all things for not being good at finding columns in CSVs that are strings.
<SnoopJeDi>
UmbralRaptor, hm?
<UmbralRaptor>
SnoopJeDi: eg: b'HIP 1475'
<SnoopJeDi>
is that two columns or one?
<UmbralRaptor>
That's a random entry in one of the columns with strings.
<SnoopJeDi>
hm. if you have some sample data and an example of the code that mangles it, I'd take a look
<UmbralRaptor>
I can probably solve this by manually specifying the datatype of each column, but that makes assumptions about the number and order of columns that I'd rather avoid.
<UmbralRaptor>
the mangling is normal np.genfromtxt("filename.csv", delimiter=",", dtype=None, Names=True)
<UmbralRaptor>
without setting dtype to none, numpy says that every entry is a float, and the strings are nans.
kmath has quit [Ping timeout: 186 seconds]
<egg>
bofh: I should try making a mug with akkadian on it :-p
<egg>
𒂍𒃲𒁹𒀸𒋩𒉽𒀀 etc.
<egg>
(I'd need a kiln tho...)
<egg>
or rather, 𒃻𒂵𒂍𒃲𒁹𒉭 I guess :-p
<egg>
UmbralRaptor: does that mean ANBO is 𒂍𒃲𒁹𒉭
* UmbralRaptor
isn't sure how you'd do acronyms in cuniform.
<egg>
UmbralRaptor: you don't, since you have sumerograms
<egg>
UmbralRaptor: (the above says palace of egg)
<egg>
UmbralRaptor: not sure how to say observatory