Hi,
Firstly I apologise for submitting a very similar question to one asked recently by my colleague. Here is a hopefully more refined version.
I have a molecule of arbitrary length, which we can measure by the number of bonds in the molecule. Each bond can be rotated independently of all others. It is common, but not absolute, that a given bond can be rotated into 3 distinct positions. And so we label each set of rotations with a string that indicates the position of each bond (i.e. normally the "1", "2" or "3" position).
I need to generate a list of all the possible molecule ID strings for a molecule that is read in. In most cases, all bond rotations will have the same degeneracy, but it would be useful to not make this assumption - i.e. bond a can rotate 3 ways, b also 3, c 2, d 3...
So for a molecule of length = 5, where all bonds can be rotated 3 ways, I need 3^5 strings of the form:
11111 11112 11113 .. 21111 21112 21113 .. 33333
Once I have the string, I need to do two things: Firstly the string will be used as a filename. Secondly I need to use each number in the string to generate the required rotation angle. This code works already, I just need to feed it.
Thanks
In reply to Generating combinatorial strings by madd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |