whizard is hosted by Hepforge, IPPP Durham

Opened 11 years ago

Closed 11 years ago

#559 closed defect (fixed)

Broken beam polarization

Reported by: Juergen Reuter Owned by: kilian
Priority: P1 Milestone: v2.2.0
Component: core Version: 2.1.1
Severity: critical Keywords:
Cc:

Description (last modified by Juergen Reuter)

Revive beam polarization

Change History (17)

comment:1 Changed 11 years ago by kilian

... and beam polarization. We discussed this, and a tentative (simplified) syntax is

beam_polarization = (1: 0.8, -1: 0.2), (....)

for a diagonal density matrix, and

beam_polarization = (1:1: 0.8, 1:-1: 0.2 * exp (I * pi / 2)), (...)

for a generic density matrix, etc. The second beam would be appended, and additional parameters like beam_polarization_fraction, beam_polarization_theta, etc. would add options.

This replaces the previous setup which has a lot of different syntax rules, and is (to me) confusing.

comment:2 Changed 11 years ago by Juergen Reuter

Description: modified (diff)
Summary: Missing beam propertiesMissing beam polarization

Beam momenta, beam angle (theta, phi), crossing angle are in a separate ticket (#579). This ticket is dedicated only to beam polarization. WK, please assign!

comment:3 Changed 11 years ago by kilian

Status: newassigned

Already under construction.

The syntax for beam polarization is new and, hopefully, useful. We should discuss it before the actual release.

comment:4 Changed 11 years ago by kilian

Resolution: fixed
Status: assignedclosed

Finally done in r5161. Documentation pending (#554).

comment:5 Changed 11 years ago by Juergen Reuter

Resolution: fixed
Status: closedreopened

I modified the example eeww_polarized.sin from the old to the new syntax:

beam_polarization = diagonal_density (hel_ep:1), diagonal_density (hel_em:1) 

to

beams_pol_density = @(hel_ep), @(hel_em) 

Then, however I get the error message:

n_events = 100000
| Particle W+ declared as polarized
| Particle W- declared as polarized
[user variable] hel_ep = -1
+  IDENTIFIER  <variable>  = hel_em
******************************************************************************
*** ERROR: This variable is undefined at this point
******************************************************************************
******************************************************************************
******************************************************************************
*** WHIZARD BUG: histogram: name expression not implemented (yet)
******************************************************************************
******************************************************************************
| There were  1 error(s) and no warnings.
WHIZARD run aborted.

(the second one clearly being a different problem. But somehow, beam polarization not yet works as intended. :(((

comment:6 Changed 11 years ago by Juergen Reuter

Leaving out the histogram stuff results in:

[user variable] hel_ep = -1
+  IDENTIFIER  <variable>  = hel_em
******************************************************************************
*** ERROR: This variable is undefined at this point
******************************************************************************
[user variable] hel_em = -1
******************************************************************************
******************************************************************************
*** FATAL ERROR: Evaluating density matrix: undefined index
******************************************************************************
******************************************************************************
| There were  1 error(s) and no warnings.
WHIZARD run aborted.

which shows the problem.

comment:7 Changed 11 years ago by Juergen Reuter

Priority: P3P0
Severity: normalcritical
Summary: Missing beam polarizationBroken beam polarization

Almost none of the given examples is working!!! Parameters are simply not respected. E.g. the density matrix with the complex values has completely wrong entries. Variables are just not carried through.

comment:8 Changed 11 years ago by Juergen Reuter

I finally understood the code. Beam_polarization == unpolarized. The code is set up in a way that all entries are always 1. Great. Flapp. Flapp.

comment:9 Changed 11 years ago by kilian

Priority: P0P1

The undefined-variable issue was due to compiling the expressions too early. This is fixed in r5255 (but see #597). Will look next if there are other issues with the beam polarization example.

comment:10 Changed 11 years ago by Juergen Reuter

Nope, also thought first that this is the issue. But apparently. the magic with the n_index vs. n_expr is completely screwed up. I'll add the correct values for the beam pols.

comment:11 Changed 11 years ago by kilian

@JR: I did get your message that there's another bug. I can go through the beam-pol example on Monday.

comment:12 Changed 11 years ago by kilian

r5256: Correct values for beam polarization matrices.

??? I don't get what you mean by those numbers. But I admit that I didn't write the documentation yet. Let's get this straight on Monday.

comment:13 Changed 11 years ago by Juergen Reuter

Well, my assumption is that the complex number being displayed after the helicity entry hel(i), hel(j) in the polarization entry is the entry of the beam polarization density matrix. For the last example in the beam_setup_1.sin file these should be 1/2, (1-i)/sqrt(2) and 1/2, but not 1, 1, 1. Correct? See my email for my confusion.

comment:14 Changed 11 years ago by kilian

The complex values are broken, yes. I was puzzled by your new ref-file entries with pure imaginary values on the diagonal. I guess these are mistakes.

As said, I'll reconsider and fix this asap.

comment:15 Changed 11 years ago by Juergen Reuter

Ok, maybe the one with the imaginary units is wrong, but I still haven't completely understood the notation. Still stymied also with the setup for the energy scan in #500.

comment:16 Changed 11 years ago by kilian

Ok, hopefully fixed in r5259.

The root cause was a mismatch in the syntax rule vs. parser, which caused the value entry to be dropped. Unfortunately, the resulting matrices were formally valid, so the sanity check didn't fail. And the further bugs in the handler of expressions vs. values couldn't even trigger ...

The notation is not changed. The meaning is i:j:x => rho(i,j) = x for each entry, where i:j => i:j:1 and i => i:i:1 is assumed. Also note that the normalization of the whole matrix is done by the program, so the user doesn't have to care. The relative normalization of off-diag vs. on-diag counts, however.

comment:17 Changed 11 years ago by kilian

Resolution: fixed
Status: reopenedclosed

Last build was ok, next attempt at closing this ticket.

Note: See TracTickets for help on using tickets.