Announcing Physics::RayTransfer
While I am still working out the bugs from Alien::Base I have released a little scientific side project named Physics::RayTransfer.
Calling all laser physicists! Does modeling your cavity using Ray Transfer (ABCD) matrices bore you? Do you regularly forget to include one of the matrices on the reversed arm on the round trip? Do you hate using that symbolic mathematical language? Try Physics::RayTranser!
It slices, dices, makes julienne fries and of course is a totally object oriented way to model your laser cavities (or other optical systems). No round trip matrices needed!
use Physics::RayTransfer;
# build the system using helper constructors
my $sys = Physics::RayTransfer->new();
$sys->add_mirror;
$sys->add_space->parameter(sub{shift});
$sys->add_mirror(8);
# parameter for for cavity length
# from 0 to 10 in 0.1 (cm) increments
my $d = [ map { $_ / 10 } (0..100) ];
# spot size at right mirror (OC) at 1063 nm
# for each cavity length!
my @data =
map { $_->[1]->w(1063e-7) }
$sys->evaluate_parameterized($d);
Finally, some of you might complain that the whole thing is written in MooseX::Declare and so you have to install that whole monstrosity just to use it. Oh well, its really fast to write, and I find writing OO scientific code very intuitive using it, so get over it. :-)
I couldn’t get it to install due to all the dependencies.
I was kinda kidding about this in that last line of mine; of course I want this to be useful for people. Do you know what failed to install? MooseX::Declare and Method::Signatures are both widely used and therefore should be fairly straightforward (if time-consuming) to install. You may email me if you like, hopefully I can help. joel dot a dot berger at gmail dot com
I’ve sent the output of cpanm and “.cpanm/build.log” by email. But I suspect the cause of the problems is that I broke the Perl library installation somehow when I was testing App::pmuninstall:
https://rt.cpan.org/Public/Bug/Display.html?id=69737
I also could not install “Dist::Zilla”. So there may be nothing wrong with your module. At some point I will have to reinstall Perl I think.
After the email exchange we had, I tried installing it on another computer, Ubuntu Linux. This is a Perl I virtually never use except for testing the installation of modules which I made, so almost everything including Moose was installed from scratch, I even had to install App::cpanminus on this machine, and it took about half an hour or so to install all the dependencies. Again the problem seems to occur in the same place (this is the output for the second attempt, after most of the other stuff had installed):
This is a completely different computer.
I thought I had most of CPAN installed already… ;) anyway, it did install and seems to work (i don’t work with lasers). I used cpanminus and a perlbrewed perl5-14.1 on Open Suse 11 (at least that’s what the admins tell me).
Building and testing Physics-RayTransfer-0.003 … OK Successfully installed Physics-RayTransfer-0.003 28 distributions installed
If the only thing that’s failing is MooseX::Method::Signatures, you can probably just ignore that. Since Joel is using Method::Signatures::Modifiers, MXMS will never be used anyway.
I really need to work on a version of MooseX::Declare that won’t even depend on MSMX, but I just haven’t had time lately. On my TODO list though.