Hi all,
Very much a TOPAS novice here, so I apologise if this is a common problem or I have just made an obvious mistake but I've spent a decent amount of time trying to solve this and can't seem to find a suitable solution.
The issue I am having is with the stacking fault functionality for more complex stacking dependencies. For my particular use case, this might not even be the correct way to approach things but I have made a more simple example of the problem and I was hoping someone could direct me as to what is going wrong and if there is any fix (potentially a keyword for a tolerance etc that I am missing?)
My example is just based on the cu_tutorial_01.inp
As far as I can tell my input file should be producing equivalent super cells to the tutorial (but maybe I am mistaken and this is the root of my issues). The change I have made is that instead of calculating transitions on a layer by layer basis (A to A, A to B etc.), I am calculating in groups of 3 layers (AAA to AAA, AAA to ABA, etc.). The overall probabilities for these transitions, I think, are unchanged, just individual transition probabilities are now much smaller.
Eg. to get AAA stacking on top of an already made AAA: in the tutorial this is 3 A to A transitions each with a probability of pa, in my example this is one transition of AAA to AAA with a probability of papapa. I think the problem seems to be related to the fact that in the example if pa = 0.9 there are only two transitions from each layer with probabilities 0.9 and 0.1, where as for my test there are now eight transitions with the smallest probability having a value of 0.001.
I have tried using:
pr_str { B layers_tol } 1
as suggested in https://topas.awh.durham.ac.uk/flarum/public/d/667-help-error-in-generate-stack-sequences-w-layers-n-w-max-stacks-allowed
but this doesn't fix the issue, the refinement does not run and I still get:
Seq 87 : Error in generate_stack_sequences : w_layers.n() > w_max_stacks_allowed 35073 35072
I can set "pr_str { B layers_tol } 1.5" to get the code to run, but the fit to the data is no longer any good so I am assuming this is no longer a productive change for values above 1?
If anyone has any insight to what I am doing wrong/ what I need to change to get this to work, I would be incredibly grateful.
My full test input file is attached
and is also pasted below.
Thanks in advance,
Andy
'input file for Cu data simulated in diffax with cu.dat
'this is the standard file distributed with diffax
'simulation from 2 to 170 degrees with step 0.01 and full adaptive quadrature options
'xye file generated from column 3 of cu.spc using I^0.5 for error
iters 100
seed
xdd cu.xye
LP_Factor(0) bkg 1
start_X 10 finish_X 149.6
rebin_with_dx_of 0.01
lam ymin_on_ymax 0.0001 la 1 lo 1.5418 lh 1e-5
Zero_Error(@,-0.00733
)
weighting 1
str
for strs {
space_group P1
a 2.5560 b 2.55560 c = Get(generated_c); ga 120
prm !pa 0.9 'probability of having a single AA or BB type transition
prm !h 6.26
prm s 4875.84407` min 1e-15 scale = s 1e-6 / (Nv Nstr);
generate_stack_sequences {
number_of_sequences Nstr 100
number_of_stacks_per_sequence Nv 133
'pr_str { B layers_tol } 1.5 'can set this to 1.5 to get it to run
Transition(AAA, AAA, h)
'all AA or BB transitions
to AAA = pa*pa*pa; a_add = 0; b_add = 0;
'one AB/BA type transition
to AAB = pa*pa*(1-pa); a_add = 0; b_add = 0;
to ABB = pa*(1-pa)*pa; a_add = 0; b_add = 0;
to BBB = (1-pa)*pa*pa; a_add = 0; b_add = 0;
'two AB/BA type transitions
to ABA = pa*(1-pa)*(1-pa); a_add = 0; b_add = 0;
to BAA = (1-pa)*(1-pa)*pa; a_add = 0; b_add = 0;
to BBA = (1-pa)*pa*(1-pa); a_add = 0; b_add = 0;
'all AB/BA type transitions
to BAB = (1-pa)*(1-pa)*(1-pa); a_add = 0; b_add = 0;
Transition(ABA, ABA, h)
'all AA or BB transitions
to AAA = pa*pa*pa; a_add = 0; b_add = 0;
'one AB/BA type transition
to AAB = pa*pa*(1-pa); a_add = 0; b_add = 0;
to ABB = pa*(1-pa)*pa; a_add = 0; b_add = 0;
to BBB = (1-pa)*pa*pa; a_add = 0; b_add = 0;
'two AB/BA type transitions
to ABA = pa*(1-pa)*(1-pa); a_add = 0; b_add = 0;
to BAA = (1-pa)*(1-pa)*pa; a_add = 0; b_add = 0;
to BBA = (1-pa)*pa*(1-pa); a_add = 0; b_add = 0;
'all AB/BA type transitions
to BAB = (1-pa)*(1-pa)*(1-pa); a_add = 0; b_add = 0;
Transition(BAA, BAA, h)
'all AA or BB transitions
to AAA = pa*pa*pa; a_add = 0; b_add = 0;
'one AB/BA type transition
to AAB = pa*pa*(1-pa); a_add = 0; b_add = 0;
to ABB = pa*(1-pa)*pa; a_add = 0; b_add = 0;
to BBB = (1-pa)*pa*pa; a_add = 0; b_add = 0;
'two AB/BA type transitions
to ABA = pa*(1-pa)*(1-pa); a_add = 0; b_add = 0;
to BAA = (1-pa)*(1-pa)*pa; a_add = 0; b_add = 0;
to BBA = (1-pa)*pa*(1-pa); a_add = 0; b_add = 0;
'all AB/BA type transitions
to BAB = (1-pa)*(1-pa)*(1-pa); a_add = 0; b_add = 0;
Transition(BBA, BBA, h)
'all AA or BB transitions
to AAA = pa*pa*pa; a_add = 0; b_add = 0;
'one AB/BA type transition
to AAB = pa*pa*(1-pa); a_add = 0; b_add = 0;
to ABB = pa*(1-pa)*pa; a_add = 0; b_add = 0;
to BBB = (1-pa)*pa*pa; a_add = 0; b_add = 0;
'two AB/BA type transitions
to ABA = pa*(1-pa)*(1-pa); a_add = 0; b_add = 0;
to BAA = (1-pa)*(1-pa)*pa; a_add = 0; b_add = 0;
to BBA = (1-pa)*pa*(1-pa); a_add = 0; b_add = 0;
'all AB/BA type transitions
to BAB = (1-pa)*(1-pa)*(1-pa); a_add = 0; b_add = 0;
Transition(AAB, AAB, h)
'all AA or BB transitions
to BBB = pa*pa*pa; a_add = 0; b_add = 0;
'one AB/BA type transition
to BBA = pa*pa*(1-pa); a_add = 0; b_add = 0;
to BAA = pa*(1-pa)*pa; a_add = 0; b_add = 0;
to AAA = (1-pa)*pa*pa; a_add = 0; b_add = 0;
'two AB/BA type transitions
to BAB = pa*(1-pa)*(1-pa); a_add = 0; b_add = 0;
to ABB = (1-pa)*(1-pa)*pa; a_add = 0; b_add = 0;
to AAB = (1-pa)*pa*(1-pa); a_add = 0; b_add = 0;
'all AB/BA type transitions
to ABA = (1-pa)*(1-pa)*(1-pa); a_add = 0; b_add = 0;
Transition(ABB, ABB, h)
'all AA or BB transitions
to BBB = pa*pa*pa; a_add = 0; b_add = 0;
'one AB/BA type transition
to BBA = pa*pa*(1-pa); a_add = 0; b_add = 0;
to BAA = pa*(1-pa)*pa; a_add = 0; b_add = 0;
to AAA = (1-pa)*pa*pa; a_add = 0; b_add = 0;
'two AB/BA type transitions
to BAB = pa*(1-pa)*(1-pa); a_add = 0; b_add = 0;
to ABB = (1-pa)*(1-pa)*pa; a_add = 0; b_add = 0;
to AAB = (1-pa)*pa*(1-pa); a_add = 0; b_add = 0;
'all AB/BA type transitions
to ABA = (1-pa)*(1-pa)*(1-pa); a_add = 0; b_add = 0;
Transition(BAB, BAB, h)
'all AA or BB transitions
to BBB = pa*pa*pa; a_add = 0; b_add = 0;
'one AB/BA type transition
to BBA = pa*pa*(1-pa); a_add = 0; b_add = 0;
to BAA = pa*(1-pa)*pa; a_add = 0; b_add = 0;
to AAA = (1-pa)*pa*pa; a_add = 0; b_add = 0;
'two AB/BA type transitions
to BAB = pa*(1-pa)*(1-pa); a_add = 0; b_add = 0;
to ABB = (1-pa)*(1-pa)*pa; a_add = 0; b_add = 0;
to AAB = (1-pa)*pa*(1-pa); a_add = 0; b_add = 0;
'all AB/BA type transitions
to ABA = (1-pa)*(1-pa)*(1-pa); a_add = 0; b_add = 0;
Transition(BBB, BBB, h)
'all AA or BB transitions
to BBB = pa*pa*pa; a_add = 0; b_add = 0;
'one AB/BA type transition
to BBA = pa*pa*(1-pa); a_add = 0; b_add = 0;
to BAA = pa*(1-pa)*pa; a_add = 0; b_add = 0;
to AAA = (1-pa)*pa*pa; a_add = 0; b_add = 0;
'two AB/BA type transitions
to BAB = pa*(1-pa)*(1-pa); a_add = 0; b_add = 0;
to ABB = (1-pa)*(1-pa)*pa; a_add = 0; b_add = 0;
to AAB = (1-pa)*pa*(1-pa); a_add = 0; b_add = 0;
'all AB/BA type transitions
to ABA = (1-pa)*(1-pa)*(1-pa); a_add = 0; b_add = 0;
'site Cu1 x =1/3; y =2/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer A
'site Cu1 x =2/3; y =1/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer B
site Cu1 x =1/3; y =2/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer AAA
site Cu2 x =1/3; y =2/3; z = (1/3)/Nv; occ Cu 1 beq @ -0.49524` layer AAA
site Cu3 x =1/3; y =2/3; z = (2/3)/Nv; occ Cu 1 beq @ -0.49524` layer AAA
site Cu1 x =2/3; y =1/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer BAA
site Cu2 x =1/3; y =2/3; z = (1/3)/Nv; occ Cu 1 beq @ -0.49524` layer BAA
site Cu3 x =1/3; y =2/3; z = (2/3)/Nv; occ Cu 1 beq @ -0.49524` layer BAA
site Cu1 x =1/3; y =2/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer ABA
site Cu2 x =2/3; y =1/3; z = (1/3)/Nv; occ Cu 1 beq @ -0.49524` layer ABA
site Cu3 x =1/3; y =2/3; z = (2/3)/Nv; occ Cu 1 beq @ -0.49524` layer ABA
site Cu1 x =1/3; y =2/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer AAB
site Cu2 x =1/3; y =2/3; z = (1/3)/Nv; occ Cu 1 beq @ -0.49524` layer AAB
site Cu3 x =2/3; y =1/3; z = (2/3)/Nv; occ Cu 1 beq @ -0.49524` layer AAB
site Cu1 x =1/3; y =2/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer ABB
site Cu2 x =2/3; y =1/3; z = (1/3)/Nv; occ Cu 1 beq @ -0.49524` layer ABB
site Cu3 x =2/3; y =1/3; z = (2/3)/Nv; occ Cu 1 beq @ -0.49524` layer ABB
site Cu1 x =2/3; y =1/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer BAB
site Cu2 x =1/3; y =2/3; z = (1/3)/Nv; occ Cu 1 beq @ -0.49524` layer BAB
site Cu3 x =2/3; y =1/3; z = (2/3)/Nv; occ Cu 1 beq @ -0.49524` layer BAB
site Cu1 x =2/3; y =1/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer BBA
site Cu2 x =2/3; y =1/3; z = (1/3)/Nv; occ Cu 1 beq @ -0.49524` layer BBA
site Cu3 x =1/3; y =2/3; z = (2/3)/Nv; occ Cu 1 beq @ -0.49524` layer BBA
site Cu1 x =2/3; y =1/3; z = 0.0/Nv; occ Cu 1 beq @ -0.49524` layer BBB
site Cu2 x =2/3; y =1/3; z = (1/3)/Nv; occ Cu 1 beq @ -0.49524` layer BBB
site Cu3 x =2/3; y =1/3; z = (2/3)/Nv; occ Cu 1 beq @ -0.49524` layer BBB
peak_buffer_based_on = Xo; peak_buffer_based_on_tol 0.1
TCHZ_Peak_Type( , 0.06032, ,-0.01272, ,-0.01003,,0, , 0.12249, , 0.01501) 'Instrument function refined with Nstr=100, Nv=5000
SF_smooth(@, 1, 1)
}
}
'{{{ output data
xdd_out temp.xyd append load out_record out_fmt out_eqn
{
" %11.5f " = X;
" %11.5f " = Yobs;
" %11.5f " = Ycalc;
" %11.5f\n " = Yobs-Ycalc;
}
'}}}
`