Ticket #823: assign_texkey.py

File assign_texkey.py, 38.5 KB (added by jblayloc, 3 years ago)

prototype for texkey generation from 04 July 2011 (jrbl)

Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4
5import re
6from random import sample
7from datetime import date
8
9from invenio import bibrecord
10from invenio.bibformat_engine import BibFormatObject
11from invenio.search_engine import perform_request_search
12
13
14alphabet = 'abcdefghijklmnopqrstuvwxyz'
15
16
17test_record_minimal = """<?xml version="1.0" encoding="UTF-8"?>
18<collection xmlns="http://www.loc.gov/MARC21/slim">
19<record>
20  <controlfield tag="001">9811388</controlfield>
21  <datafield tag="100" ind1=" " ind2=" ">
22    <subfield code="a">Penati, Silvia</subfield>
23    <subfield code="u">Milan Bicocca U.</subfield>
24    <subfield code="u">INFN, Milan Bicocca</subfield>
25  </datafield>
26</record>
27</collection>
28"""
29
30test_record_valid_texkey = """<?xml version="1.0" encoding="UTF-8"?>
31<collection xmlns="http://www.loc.gov/MARC21/slim">
32<record>
33  <controlfield tag="001">811388</controlfield>
34  <datafield tag="970" ind1=" " ind2=" ">
35    <subfield code="a">SPIRES-8125651</subfield>
36  </datafield>
37  <datafield tag="100" ind1=" " ind2=" ">
38    <subfield code="a">Penati, Silvia</subfield>
39    <subfield code="u">Milan Bicocca U.</subfield>
40    <subfield code="u">INFN, Milan Bicocca</subfield>
41  </datafield>
42  <datafield tag="700" ind1=" " ind2=" ">
43    <subfield code="a">Romagnoni, Alberto</subfield>
44    <subfield code="u">Orsay, LPT</subfield>
45    <subfield code="u">Ecole Polytechnique, CPHT</subfield>
46  </datafield>
47  <datafield tag="773" ind1=" " ind2=" ">
48    <subfield code="p">JHEP</subfield>
49    <subfield code="v">0903</subfield>
50    <subfield code="c">112</subfield>
51    <subfield code="y">2009</subfield>
52    <subfield code="a">10.1088/1126-6708/2009/03/112</subfield>
53  </datafield>
54  <datafield tag="856" ind1="4" ind2=" ">
55    <subfield code="u">http://inspirebeta.net/record/811388/files/chiral0-1.png</subfield>
56    <subfield code="y">00000 One--loop two--point functions with chiral externalfields.</subfield>
57  </datafield>
58  <datafield tag="650" ind1="1" ind2="7">
59    <subfield code="a">Theory-HEP</subfield>
60    <subfield code="2">INSPIRE</subfield>
61  </datafield>
62  <datafield tag="690" ind1="C" ind2=" ">
63    <subfield code="a">Published</subfield>
64    <subfield code="2">INSPIRE</subfield>
65  </datafield>
66  <datafield tag="999" ind1="C" ind2="5">
67    <subfield code="r">hep-th/9908142</subfield>
68    <subfield code="s">JHEP,9909,032</subfield>
69  </datafield>
70  <datafield tag="037" ind1=" " ind2=" ">
71    <subfield code="a">arXiv:0901.3094</subfield>
72    <subfield code="9">arXiv</subfield>
73    <subfield code="c">hep-th</subfield>
74  </datafield>
75  <datafield tag="035" ind1=" " ind2=" ">
76    <subfield code="a">oai:arXiv.org:0901.3094</subfield>
77    <subfield code="z">oai:arXiv.org:0901.3094</subfield>
78    <subfield code="9">arXiv</subfield>
79  </datafield>
80  <datafield tag="245" ind1=" " ind2=" ">
81    <subfield code="a">A Renormalizable N=1/2 SYM theory with interacting matter</subfield>
82  </datafield>
83  <datafield tag="300" ind1=" " ind2=" ">
84    <subfield code="a">38</subfield>
85  </datafield>
86  <datafield tag="520" ind1=" " ind2=" ">
87    <subfield code="a">We consider nonanticommutative SYM theories with chiral matter in the adjoint representation of the SU(N) x U(1) gauge group. In a superspace setup and manifest background covariant approach we investigate the one-loop renormalization of the theory when a cubic superpotential is present. The structure of the divergent terms reveals that the theory simply obtained from the ordinary one by trading products for star products is not renormalizable. Moreover, because of the different renormalization undergone by the abelian field compared to the non-abelian ones, the superpotential seems to be incompatible with the requests of renormalizability, gauge and N=1/2 invariance. However, by a suitable modification of the quadratic action for the U(1) (anti)chiral superfields and the addition of extra couplings, we find an action which is one-loop renormalizable and manifestly N=1/2 supersymmetric and supergauge invariant. We conclude that interacting matter can be safely introduced in NAC gauge theories, in contrast with previous results.</subfield>
88    <subfield code="9">arXiv</subfield>
89  </datafield>
90  <datafield tag="695" ind1=" " ind2=" ">
91    <subfield code="a">matter: chiral</subfield>
92    <subfield code="2">INSPIRE</subfield>
93  </datafield>
94  <datafield tag="246" ind1=" " ind2=" ">
95    <subfield code="a">A renormalizable N=1/2 SYM theory with interacting matter</subfield>
96    <subfield code="9">arXiv</subfield>
97  </datafield>
98  <datafield tag="035" ind1=" " ind2=" ">
99    <subfield code="z">Penati:2009sw</subfield>
100    <subfield code="9">SPIRESTeX</subfield>
101  </datafield>
102  <datafield tag="980" ind1=" " ind2=" ">
103    <subfield code="a">Published</subfield>
104  </datafield>
105  <datafield tag="269" ind1=" " ind2=" ">
106    <subfield code="c">2009-01</subfield>
107  </datafield>
108  <datafield tag="961" ind1=" " ind2=" ">
109    <subfield code="c">2010-01-28</subfield>
110  </datafield>
111</record>
112</collection>
113"""
114
115test_record_no_texkey_no_date_no_author_no_collaboration = """<?xml version="1.0" encoding="UTF-8"?>
116<collection xmlns="http://www.loc.gov/MARC21/slim">
117<record>
118  <controlfield tag="001">811388</controlfield>
119  <datafield tag="970" ind1=" " ind2=" ">
120    <subfield code="a">SPIRES-8125651</subfield>
121  </datafield>
122  <datafield tag="773" ind1=" " ind2=" ">
123    <subfield code="p">JHEP</subfield>
124    <subfield code="v">0903</subfield>
125    <subfield code="c">112</subfield>
126    <subfield code="y">2009</subfield>
127    <subfield code="a">10.1088/1126-6708/2009/03/112</subfield>
128  </datafield>
129  <datafield tag="856" ind1="4" ind2=" ">
130    <subfield code="u">http://inspirebeta.net/record/811388/files/chiral0-1.png</subfield>
131    <subfield code="y">00000 One--loop two--point functions with chiral externalfields.</subfield>
132  </datafield>
133  <datafield tag="650" ind1="1" ind2="7">
134    <subfield code="a">Theory-HEP</subfield>
135    <subfield code="2">INSPIRE</subfield>
136  </datafield>
137  <datafield tag="690" ind1="C" ind2=" ">
138    <subfield code="a">Published</subfield>
139    <subfield code="2">INSPIRE</subfield>
140  </datafield>
141  <datafield tag="999" ind1="C" ind2="5">
142    <subfield code="r">hep-th/9908142</subfield>
143    <subfield code="s">JHEP,9909,032</subfield>
144  </datafield>
145  <datafield tag="037" ind1=" " ind2=" ">
146    <subfield code="a">arXiv:0901.3094</subfield>
147    <subfield code="9">arXiv</subfield>
148    <subfield code="c">hep-th</subfield>
149  </datafield>
150  <datafield tag="035" ind1=" " ind2=" ">
151    <subfield code="a">oai:arXiv.org:0901.3094</subfield>
152    <subfield code="z">oai:arXiv.org:0901.3094</subfield>
153    <subfield code="9">arXiv</subfield>
154  </datafield>
155  <datafield tag="245" ind1=" " ind2=" ">
156    <subfield code="a">A Renormalizable N=1/2 SYM theory with interacting matter</subfield>
157  </datafield>
158  <datafield tag="300" ind1=" " ind2=" ">
159    <subfield code="a">38</subfield>
160  </datafield>
161  <datafield tag="520" ind1=" " ind2=" ">
162    <subfield code="a">We consider nonanticommutative SYM theories with chiral matter in the adjoint representation of the SU(N) x U(1) gauge group. In a superspace setup and manifest background covariant approach we investigate the one-loop renormalization of the theory when a cubic superpotential is present. The structure of the divergent terms reveals that the theory simply obtained from the ordinary one by trading products for star products is not renormalizable. Moreover, because of the different renormalization undergone by the abelian field compared to the non-abelian ones, the superpotential seems to be incompatible with the requests of renormalizability, gauge and N=1/2 invariance. However, by a suitable modification of the quadratic action for the U(1) (anti)chiral superfields and the addition of extra couplings, we find an action which is one-loop renormalizable and manifestly N=1/2 supersymmetric and supergauge invariant. We conclude that interacting matter can be safely introduced in NAC gauge theories, in contrast with previous results.</subfield>
163    <subfield code="9">arXiv</subfield>
164  </datafield>
165  <datafield tag="695" ind1=" " ind2=" ">
166    <subfield code="a">matter: chiral</subfield>
167    <subfield code="2">INSPIRE</subfield>
168  </datafield>
169  <datafield tag="246" ind1=" " ind2=" ">
170    <subfield code="a">A renormalizable N=1/2 SYM theory with interacting matter</subfield>
171    <subfield code="9">arXiv</subfield>
172  </datafield>
173  <datafield tag="980" ind1=" " ind2=" ">
174    <subfield code="a">Published</subfield>
175  </datafield>
176</record>
177</collection>
178"""
179
180test_record_no_texkey_no_date_no_author_no_collaboration_no_title = """<?xml version="1.0" encoding="UTF-8"?>
181<collection xmlns="http://www.loc.gov/MARC21/slim">
182<record>
183  <controlfield tag="001">811388</controlfield>
184  <datafield tag="970" ind1=" " ind2=" ">
185    <subfield code="a">SPIRES-8125651</subfield>
186  </datafield>
187  <datafield tag="773" ind1=" " ind2=" ">
188    <subfield code="p">JHEP</subfield>
189    <subfield code="v">0903</subfield>
190    <subfield code="c">112</subfield>
191    <subfield code="y">2009</subfield>
192    <subfield code="a">10.1088/1126-6708/2009/03/112</subfield>
193  </datafield>
194  <datafield tag="856" ind1="4" ind2=" ">
195    <subfield code="u">http://inspirebeta.net/record/811388/files/chiral0-1.png</subfield>
196    <subfield code="y">00000 One--loop two--point functions with chiral externalfields.</subfield>
197  </datafield>
198  <datafield tag="650" ind1="1" ind2="7">
199    <subfield code="a">Theory-HEP</subfield>
200    <subfield code="2">INSPIRE</subfield>
201  </datafield>
202  <datafield tag="690" ind1="C" ind2=" ">
203    <subfield code="a">Published</subfield>
204    <subfield code="2">INSPIRE</subfield>
205  </datafield>
206  <datafield tag="999" ind1="C" ind2="5">
207    <subfield code="r">hep-th/9908142</subfield>
208    <subfield code="s">JHEP,9909,032</subfield>
209  </datafield>
210  <datafield tag="037" ind1=" " ind2=" ">
211    <subfield code="a">arXiv:0901.3094</subfield>
212    <subfield code="9">arXiv</subfield>
213    <subfield code="c">hep-th</subfield>
214  </datafield>
215  <datafield tag="035" ind1=" " ind2=" ">
216    <subfield code="a">oai:arXiv.org:0901.3094</subfield>
217    <subfield code="z">oai:arXiv.org:0901.3094</subfield>
218    <subfield code="9">arXiv</subfield>
219  </datafield>
220  <datafield tag="300" ind1=" " ind2=" ">
221    <subfield code="a">38</subfield>
222  </datafield>
223  <datafield tag="520" ind1=" " ind2=" ">
224    <subfield code="a">We consider nonanticommutative SYM theories with chiral matter in the adjoint representation of the SU(N) x U(1) gauge group. In a superspace setup and manifest background covariant approach we investigate the one-loop renormalization of the theory when a cubic superpotential is present. The structure of the divergent terms reveals that the theory simply obtained from the ordinary one by trading products for star products is not renormalizable. Moreover, because of the different renormalization undergone by the abelian field compared to the non-abelian ones, the superpotential seems to be incompatible with the requests of renormalizability, gauge and N=1/2 invariance. However, by a suitable modification of the quadratic action for the U(1) (anti)chiral superfields and the addition of extra couplings, we find an action which is one-loop renormalizable and manifestly N=1/2 supersymmetric and supergauge invariant. We conclude that interacting matter can be safely introduced in NAC gauge theories, in contrast with previous results.</subfield>
225    <subfield code="9">arXiv</subfield>
226  </datafield>
227  <datafield tag="695" ind1=" " ind2=" ">
228    <subfield code="a">matter: chiral</subfield>
229    <subfield code="2">INSPIRE</subfield>
230  </datafield>
231  <datafield tag="246" ind1=" " ind2=" ">
232    <subfield code="a">A renormalizable N=1/2 SYM theory with interacting matter</subfield>
233    <subfield code="9">arXiv</subfield>
234  </datafield>
235  <datafield tag="980" ind1=" " ind2=" ">
236    <subfield code="a">Published</subfield>
237  </datafield>
238</record>
239</collection>
240"""
241
242test_record_no_texkey_yes_date_no_author_no_collaboration = """<?xml version="1.0" encoding="UTF-8"?>
243<collection xmlns="http://www.loc.gov/MARC21/slim">
244<record>
245  <controlfield tag="001">811388</controlfield>
246  <datafield tag="970" ind1=" " ind2=" ">
247    <subfield code="a">SPIRES-8125651</subfield>
248  </datafield>
249  <datafield tag="773" ind1=" " ind2=" ">
250    <subfield code="p">JHEP</subfield>
251    <subfield code="v">0903</subfield>
252    <subfield code="c">112</subfield>
253    <subfield code="y">2009</subfield>
254    <subfield code="a">10.1088/1126-6708/2009/03/112</subfield>
255  </datafield>
256  <datafield tag="856" ind1="4" ind2=" ">
257    <subfield code="u">http://inspirebeta.net/record/811388/files/chiral0-1.png</subfield>
258    <subfield code="y">00000 One--loop two--point functions with chiral externalfields.</subfield>
259  </datafield>
260  <datafield tag="650" ind1="1" ind2="7">
261    <subfield code="a">Theory-HEP</subfield>
262    <subfield code="2">INSPIRE</subfield>
263  </datafield>
264  <datafield tag="690" ind1="C" ind2=" ">
265    <subfield code="a">Published</subfield>
266    <subfield code="2">INSPIRE</subfield>
267  </datafield>
268  <datafield tag="999" ind1="C" ind2="5">
269    <subfield code="r">hep-th/9908142</subfield>
270    <subfield code="s">JHEP,9909,032</subfield>
271  </datafield>
272  <datafield tag="037" ind1=" " ind2=" ">
273    <subfield code="a">arXiv:0901.3094</subfield>
274    <subfield code="9">arXiv</subfield>
275    <subfield code="c">hep-th</subfield>
276  </datafield>
277  <datafield tag="035" ind1=" " ind2=" ">
278    <subfield code="a">oai:arXiv.org:0901.3094</subfield>
279    <subfield code="z">oai:arXiv.org:0901.3094</subfield>
280    <subfield code="9">arXiv</subfield>
281  </datafield>
282  <datafield tag="245" ind1=" " ind2=" ">
283    <subfield code="a">A Renormalizable N=1/2 SYM theory with interacting matter</subfield>
284  </datafield>
285  <datafield tag="300" ind1=" " ind2=" ">
286    <subfield code="a">38</subfield>
287  </datafield>
288  <datafield tag="520" ind1=" " ind2=" ">
289    <subfield code="a">We consider nonanticommutative SYM theories with chiral matter in the adjoint representation of the SU(N) x U(1) gauge group. In a superspace setup and manifest background covariant approach we investigate the one-loop renormalization of the theory when a cubic superpotential is present. The structure of the divergent terms reveals that the theory simply obtained from the ordinary one by trading products for star products is not renormalizable. Moreover, because of the different renormalization undergone by the abelian field compared to the non-abelian ones, the superpotential seems to be incompatible with the requests of renormalizability, gauge and N=1/2 invariance. However, by a suitable modification of the quadratic action for the U(1) (anti)chiral superfields and the addition of extra couplings, we find an action which is one-loop renormalizable and manifestly N=1/2 supersymmetric and supergauge invariant. We conclude that interacting matter can be safely introduced in NAC gauge theories, in contrast with previous results.</subfield>
290    <subfield code="9">arXiv</subfield>
291  </datafield>
292  <datafield tag="695" ind1=" " ind2=" ">
293    <subfield code="a">matter: chiral</subfield>
294    <subfield code="2">INSPIRE</subfield>
295  </datafield>
296  <datafield tag="246" ind1=" " ind2=" ">
297    <subfield code="a">A renormalizable N=1/2 SYM theory with interacting matter</subfield>
298    <subfield code="9">arXiv</subfield>
299  </datafield>
300  <datafield tag="980" ind1=" " ind2=" ">
301    <subfield code="a">Published</subfield>
302  </datafield>
303  <datafield tag="269" ind1=" " ind2=" ">
304    <subfield code="c">2009-01</subfield>
305  </datafield>
306  <datafield tag="961" ind1=" " ind2=" ">
307    <subfield code="c">2010-01-28</subfield>
308  </datafield>
309</record>
310</collection>
311"""
312
313test_record_no_texkey_yes_date_no_author_yes_collaboration = """<?xml version="1.0" encoding="UTF-8"?>
314<collection xmlns="http://www.loc.gov/MARC21/slim">
315<record>
316  <controlfield tag="001">811388</controlfield>
317  <datafield tag="970" ind1=" " ind2=" ">
318    <subfield code="a">SPIRES-8125651</subfield>
319  </datafield>
320  <datafield tag="710" ind1=" " ind2=" ">
321   <subfield code="g">ATLAS</subfield>
322  </datafield>
323  <datafield tag="773" ind1=" " ind2=" ">
324    <subfield code="p">JHEP</subfield>
325    <subfield code="v">0903</subfield>
326    <subfield code="c">112</subfield>
327    <subfield code="y">2009</subfield>
328    <subfield code="a">10.1088/1126-6708/2009/03/112</subfield>
329  </datafield>
330  <datafield tag="856" ind1="4" ind2=" ">
331    <subfield code="u">http://inspirebeta.net/record/811388/files/chiral0-1.png</subfield>
332    <subfield code="y">00000 One--loop two--point functions with chiral externalfields.</subfield>
333  </datafield>
334  <datafield tag="650" ind1="1" ind2="7">
335    <subfield code="a">Theory-HEP</subfield>
336    <subfield code="2">INSPIRE</subfield>
337  </datafield>
338  <datafield tag="690" ind1="C" ind2=" ">
339    <subfield code="a">Published</subfield>
340    <subfield code="2">INSPIRE</subfield>
341  </datafield>
342  <datafield tag="999" ind1="C" ind2="5">
343    <subfield code="r">hep-th/9908142</subfield>
344    <subfield code="s">JHEP,9909,032</subfield>
345  </datafield>
346  <datafield tag="037" ind1=" " ind2=" ">
347    <subfield code="a">arXiv:0901.3094</subfield>
348    <subfield code="9">arXiv</subfield>
349    <subfield code="c">hep-th</subfield>
350  </datafield>
351  <datafield tag="035" ind1=" " ind2=" ">
352    <subfield code="a">oai:arXiv.org:0901.3094</subfield>
353    <subfield code="z">oai:arXiv.org:0901.3094</subfield>
354    <subfield code="9">arXiv</subfield>
355  </datafield>
356  <datafield tag="245" ind1=" " ind2=" ">
357    <subfield code="a">A Renormalizable N=1/2 SYM theory with interacting matter</subfield>
358  </datafield>
359  <datafield tag="300" ind1=" " ind2=" ">
360    <subfield code="a">38</subfield>
361  </datafield>
362  <datafield tag="520" ind1=" " ind2=" ">
363    <subfield code="a">We consider nonanticommutative SYM theories with chiral matter in the adjoint representation of the SU(N) x U(1) gauge group. In a superspace setup and manifest background covariant approach we investigate the one-loop renormalization of the theory when a cubic superpotential is present. The structure of the divergent terms reveals that the theory simply obtained from the ordinary one by trading products for star products is not renormalizable. Moreover, because of the different renormalization undergone by the abelian field compared to the non-abelian ones, the superpotential seems to be incompatible with the requests of renormalizability, gauge and N=1/2 invariance. However, by a suitable modification of the quadratic action for the U(1) (anti)chiral superfields and the addition of extra couplings, we find an action which is one-loop renormalizable and manifestly N=1/2 supersymmetric and supergauge invariant. We conclude that interacting matter can be safely introduced in NAC gauge theories, in contrast with previous results.</subfield>
364    <subfield code="9">arXiv</subfield>
365  </datafield>
366  <datafield tag="695" ind1=" " ind2=" ">
367    <subfield code="a">matter: chiral</subfield>
368    <subfield code="2">INSPIRE</subfield>
369  </datafield>
370  <datafield tag="246" ind1=" " ind2=" ">
371    <subfield code="a">A renormalizable N=1/2 SYM theory with interacting matter</subfield>
372    <subfield code="9">arXiv</subfield>
373  </datafield>
374  <datafield tag="980" ind1=" " ind2=" ">
375    <subfield code="a">Published</subfield>
376  </datafield>
377  <datafield tag="269" ind1=" " ind2=" ">
378    <subfield code="c">2009-01</subfield>
379  </datafield>
380  <datafield tag="961" ind1=" " ind2=" ">
381    <subfield code="c">2010-01-28</subfield>
382  </datafield>
383</record>
384</collection>
385"""
386
387test_record_no_texkey_yes_date_yes_author_no_collaboration = """<?xml version="1.0" encoding="UTF-8"?>
388<collection xmlns="http://www.loc.gov/MARC21/slim">
389<record>
390  <controlfield tag="001">811388</controlfield>
391  <datafield tag="970" ind1=" " ind2=" ">
392    <subfield code="a">SPIRES-8125651</subfield>
393  </datafield>
394  <datafield tag="100" ind1=" " ind2=" ">
395    <subfield code="a">Penati, Silvia</subfield>
396    <subfield code="u">Milan Bicocca U.</subfield>
397    <subfield code="u">INFN, Milan Bicocca</subfield>
398  </datafield>
399  <datafield tag="700" ind1=" " ind2=" ">
400    <subfield code="a">Romagnoni, Alberto</subfield>
401    <subfield code="u">Orsay, LPT</subfield>
402    <subfield code="u">Ecole Polytechnique, CPHT</subfield>
403  </datafield>
404  <datafield tag="773" ind1=" " ind2=" ">
405    <subfield code="p">JHEP</subfield>
406    <subfield code="v">0903</subfield>
407    <subfield code="c">112</subfield>
408    <subfield code="y">2009</subfield>
409    <subfield code="a">10.1088/1126-6708/2009/03/112</subfield>
410  </datafield>
411  <datafield tag="856" ind1="4" ind2=" ">
412    <subfield code="u">http://inspirebeta.net/record/811388/files/chiral0-1.png</subfield>
413    <subfield code="y">00000 One--loop two--point functions with chiral externalfields.</subfield>
414  </datafield>
415  <datafield tag="650" ind1="1" ind2="7">
416    <subfield code="a">Theory-HEP</subfield>
417    <subfield code="2">INSPIRE</subfield>
418  </datafield>
419  <datafield tag="690" ind1="C" ind2=" ">
420    <subfield code="a">Published</subfield>
421    <subfield code="2">INSPIRE</subfield>
422  </datafield>
423  <datafield tag="999" ind1="C" ind2="5">
424    <subfield code="r">hep-th/9908142</subfield>
425    <subfield code="s">JHEP,9909,032</subfield>
426  </datafield>
427  <datafield tag="037" ind1=" " ind2=" ">
428    <subfield code="a">arXiv:0901.3094</subfield>
429    <subfield code="9">arXiv</subfield>
430    <subfield code="c">hep-th</subfield>
431  </datafield>
432  <datafield tag="035" ind1=" " ind2=" ">
433    <subfield code="a">oai:arXiv.org:0901.3094</subfield>
434    <subfield code="z">oai:arXiv.org:0901.3094</subfield>
435    <subfield code="9">arXiv</subfield>
436  </datafield>
437  <datafield tag="245" ind1=" " ind2=" ">
438    <subfield code="a">A Renormalizable N=1/2 SYM theory with interacting matter</subfield>
439  </datafield>
440  <datafield tag="300" ind1=" " ind2=" ">
441    <subfield code="a">38</subfield>
442  </datafield>
443  <datafield tag="520" ind1=" " ind2=" ">
444    <subfield code="a">We consider nonanticommutative SYM theories with chiral matter in the adjoint representation of the SU(N) x U(1) gauge group. In a superspace setup and manifest background covariant approach we investigate the one-loop renormalization of the theory when a cubic superpotential is present. The structure of the divergent terms reveals that the theory simply obtained from the ordinary one by trading products for star products is not renormalizable. Moreover, because of the different renormalization undergone by the abelian field compared to the non-abelian ones, the superpotential seems to be incompatible with the requests of renormalizability, gauge and N=1/2 invariance. However, by a suitable modification of the quadratic action for the U(1) (anti)chiral superfields and the addition of extra couplings, we find an action which is one-loop renormalizable and manifestly N=1/2 supersymmetric and supergauge invariant. We conclude that interacting matter can be safely introduced in NAC gauge theories, in contrast with previous results.</subfield>
445    <subfield code="9">arXiv</subfield>
446  </datafield>
447  <datafield tag="695" ind1=" " ind2=" ">
448    <subfield code="a">matter: chiral</subfield>
449    <subfield code="2">INSPIRE</subfield>
450  </datafield>
451  <datafield tag="246" ind1=" " ind2=" ">
452    <subfield code="a">A renormalizable N=1/2 SYM theory with interacting matter</subfield>
453    <subfield code="9">arXiv</subfield>
454  </datafield>
455  <datafield tag="980" ind1=" " ind2=" ">
456    <subfield code="a">Published</subfield>
457  </datafield>
458  <datafield tag="269" ind1=" " ind2=" ">
459    <subfield code="c">2009-01</subfield>
460  </datafield>
461  <datafield tag="961" ind1=" " ind2=" ">
462    <subfield code="c">2010-01-28</subfield>
463  </datafield>
464</record>
465</collection>
466"""
467
468test_record_no_texkey_metadata_match_a = """<?xml version="1.0" encoding="UTF-8"?>
469<collection xmlns="http://www.loc.gov/MARC21/slim">
470<record>
471  <controlfield tag="001">9811382</controlfield>
472  <datafield tag="970" ind1=" " ind2=" ">
473    <subfield code="a">SPIRES-8125651</subfield>
474  </datafield>
475  <datafield tag="100" ind1=" " ind2=" ">
476    <subfield code="a">Penati, Silvia</subfield>
477    <subfield code="u">Milan Bicocca U.</subfield>
478    <subfield code="u">INFN, Milan Bicocca</subfield>
479  </datafield>
480  <datafield tag="700" ind1=" " ind2=" ">
481    <subfield code="a">Romagnoni, Alberto</subfield>
482    <subfield code="u">Orsay, LPT</subfield>
483    <subfield code="u">Ecole Polytechnique, CPHT</subfield>
484  </datafield>
485  <datafield tag="773" ind1=" " ind2=" ">
486    <subfield code="p">JHEP</subfield>
487    <subfield code="v">0903</subfield>
488    <subfield code="c">112</subfield>
489    <subfield code="y">2009</subfield>
490    <subfield code="a">10.1088/1126-6708/2009/03/112</subfield>
491  </datafield>
492  <datafield tag="856" ind1="4" ind2=" ">
493    <subfield code="u">http://inspirebeta.net/record/811388/files/chiral0-1.png</subfield>
494    <subfield code="y">00000 One--loop two--point functions with chiral externalfields.</subfield>
495  </datafield>
496  <datafield tag="650" ind1="1" ind2="7">
497    <subfield code="a">Theory-HEP</subfield>
498    <subfield code="2">INSPIRE</subfield>
499  </datafield>
500  <datafield tag="690" ind1="C" ind2=" ">
501    <subfield code="a">Published</subfield>
502    <subfield code="2">INSPIRE</subfield>
503  </datafield>
504  <datafield tag="999" ind1="C" ind2="5">
505    <subfield code="r">hep-th/9908142</subfield>
506    <subfield code="s">JHEP,9909,032</subfield>
507  </datafield>
508  <datafield tag="037" ind1=" " ind2=" ">
509    <subfield code="a">arXiv:0901.3094</subfield>
510    <subfield code="9">arXiv</subfield>
511    <subfield code="c">hep-th</subfield>
512  </datafield>
513  <datafield tag="035" ind1=" " ind2=" ">
514    <subfield code="a">oai:arXiv.org:0901.3094</subfield>
515    <subfield code="z">oai:arXiv.org:0901.3094</subfield>
516    <subfield code="9">arXiv</subfield>
517  </datafield>
518  <datafield tag="245" ind1=" " ind2=" ">
519    <subfield code="a">A Renormalizable N=1/2 SYM theory with interacting matter</subfield>
520  </datafield>
521  <datafield tag="300" ind1=" " ind2=" ">
522    <subfield code="a">38</subfield>
523  </datafield>
524  <datafield tag="520" ind1=" " ind2=" ">
525    <subfield code="a">We consider nonanticommutative SYM theories with chiral matter in the adjoint representation of the SU(N) x U(1) gauge group. In a superspace setup and manifest background covariant approach we investigate the one-loop renormalization of the theory when a cubic superpotential is present. The structure of the divergent terms reveals that the theory simply obtained from the ordinary one by trading products for star products is not renormalizable. Moreover, because of the different renormalization undergone by the abelian field compared to the non-abelian ones, the superpotential seems to be incompatible with the requests of renormalizability, gauge and N=1/2 invariance. However, by a suitable modification of the quadratic action for the U(1) (anti)chiral superfields and the addition of extra couplings, we find an action which is one-loop renormalizable and manifestly N=1/2 supersymmetric and supergauge invariant. We conclude that interacting matter can be safely introduced in NAC gauge theories, in contrast with previous results.</subfield>
526    <subfield code="9">arXiv</subfield>
527  </datafield>
528  <datafield tag="695" ind1=" " ind2=" ">
529    <subfield code="a">matter: chiral</subfield>
530    <subfield code="2">INSPIRE</subfield>
531  </datafield>
532  <datafield tag="246" ind1=" " ind2=" ">
533    <subfield code="a">A renormalizable N=1/2 SYM theory with interacting matter</subfield>
534    <subfield code="9">arXiv</subfield>
535  </datafield>
536  <datafield tag="980" ind1=" " ind2=" ">
537    <subfield code="a">Published</subfield>
538  </datafield>
539  <datafield tag="269" ind1=" " ind2=" ">
540    <subfield code="c">2009-01</subfield>
541  </datafield>
542  <datafield tag="961" ind1=" " ind2=" ">
543    <subfield code="c">2010-01-28</subfield>
544  </datafield>
545</record>
546</collection>
547"""
548
549test_record_no_texkey_metadata_match_b = """<?xml version="1.0" encoding="UTF-8"?>
550<collection xmlns="http://www.loc.gov/MARC21/slim">
551<record>
552  <controlfield tag="001">9811381</controlfield>
553  <datafield tag="970" ind1=" " ind2=" ">
554    <subfield code="a">SPIRES-8125651</subfield>
555  </datafield>
556  <datafield tag="100" ind1=" " ind2=" ">
557    <subfield code="a">Penati, Silvia</subfield>
558    <subfield code="u">Milan Bicocca U.</subfield>
559    <subfield code="u">INFN, Milan Bicocca</subfield>
560  </datafield>
561  <datafield tag="700" ind1=" " ind2=" ">
562    <subfield code="a">Romagnoni, Alberto</subfield>
563    <subfield code="u">Orsay, LPT</subfield>
564    <subfield code="u">Ecole Polytechnique, CPHT</subfield>
565  </datafield>
566  <datafield tag="773" ind1=" " ind2=" ">
567    <subfield code="p">JHEP</subfield>
568    <subfield code="v">0903</subfield>
569    <subfield code="c">112</subfield>
570    <subfield code="y">2009</subfield>
571    <subfield code="a">10.1088/1126-6708/2009/03/112</subfield>
572  </datafield>
573  <datafield tag="856" ind1="4" ind2=" ">
574    <subfield code="u">http://inspirebeta.net/record/811388/files/chiral0-1.png</subfield>
575    <subfield code="y">00000 One--loop two--point functions with chiral externalfields.</subfield>
576  </datafield>
577  <datafield tag="650" ind1="1" ind2="7">
578    <subfield code="a">Theory-HEP</subfield>
579    <subfield code="2">INSPIRE</subfield>
580  </datafield>
581  <datafield tag="690" ind1="C" ind2=" ">
582    <subfield code="a">Published</subfield>
583    <subfield code="2">INSPIRE</subfield>
584  </datafield>
585  <datafield tag="999" ind1="C" ind2="5">
586    <subfield code="r">hep-th/9908142</subfield>
587    <subfield code="s">JHEP,9909,032</subfield>
588  </datafield>
589  <datafield tag="037" ind1=" " ind2=" ">
590    <subfield code="a">arXiv:0901.3094</subfield>
591    <subfield code="9">arXiv</subfield>
592    <subfield code="c">hep-th</subfield>
593  </datafield>
594  <datafield tag="035" ind1=" " ind2=" ">
595    <subfield code="a">oai:arXiv.org:0901.3094</subfield>
596    <subfield code="z">oai:arXiv.org:0901.3094</subfield>
597    <subfield code="9">arXiv</subfield>
598  </datafield>
599  <datafield tag="245" ind1=" " ind2=" ">
600    <subfield code="a">A Renormalizable N=1/2 SYM theory with interacting matter</subfield>
601  </datafield>
602  <datafield tag="300" ind1=" " ind2=" ">
603    <subfield code="a">38</subfield>
604  </datafield>
605  <datafield tag="520" ind1=" " ind2=" ">
606    <subfield code="a">We consider nonanticommutative SYM theories with chiral matter in the adjoint representation of the SU(N) x U(1) gauge group. In a superspace setup and manifest background covariant approach we investigate the one-loop renormalization of the theory when a cubic superpotential is present. The structure of the divergent terms reveals that the theory simply obtained from the ordinary one by trading products for star products is not renormalizable. Moreover, because of the different renormalization undergone by the abelian field compared to the non-abelian ones, the superpotential seems to be incompatible with the requests of renormalizability, gauge and N=1/2 invariance. However, by a suitable modification of the quadratic action for the U(1) (anti)chiral superfields and the addition of extra couplings, we find an action which is one-loop renormalizable and manifestly N=1/2 supersymmetric and supergauge invariant. We conclude that interacting matter can be safely introduced in NAC gauge theories, in contrast with previous results.</subfield>
607    <subfield code="9">arXiv</subfield>
608  </datafield>
609  <datafield tag="695" ind1=" " ind2=" ">
610    <subfield code="a">matter: chiral</subfield>
611    <subfield code="2">INSPIRE</subfield>
612  </datafield>
613  <datafield tag="246" ind1=" " ind2=" ">
614    <subfield code="a">A renormalizable N=1/2 SYM theory with interacting matter</subfield>
615    <subfield code="9">arXiv</subfield>
616  </datafield>
617  <datafield tag="980" ind1=" " ind2=" ">
618    <subfield code="a">Published</subfield>
619  </datafield>
620  <datafield tag="269" ind1=" " ind2=" ">
621    <subfield code="c">2009-01</subfield>
622  </datafield>
623  <datafield tag="961" ind1=" " ind2=" ">
624    <subfield code="c">2010-01-28</subfield>
625  </datafield>
626</record>
627</collection>
628"""
629
630
631def debug_print(s):
632    import sys
633    sys.stderr.write(s+'\n')
634
635class B36Int(object):
636    """Model a base-36 integer whose value can only ever increase."""
637    def __init__(self, initializer='0'):
638        self.__eic = int(initializer, 36) # our ever-increasing counter, from db
639
640    def output_b36(self):
641        """Return the value of the ever-increasing-counter in base-36"""
642        quotient = self.__eic
643        result = []
644        while quotient > 35:
645            remainder = quotient % 36
646            quotient /= 36
647            result.append(remainder)
648        result.append(quotient)
649        result.reverse()
650        result = ['0123456789abcdefghijklmnopqrstuvwxyz'[index] for index in result]
651        result = ''.join(result)
652        return result
653
654    def __int__(self):
655        return self.__eic
656
657    def __str__(self):
658        return self.output_b36()
659
660    def __repr__(self):
661        return self.output_b36()
662       
663    def increase(self, value=1):
664        self.__eic += value
665
666
667def get_texkey(record):
668    """Given a BibFormatObject, return the SPIRES TeXkey or empty string"""
669    for field in record.fields('035'):
670        if '9' in field and field['9'] == 'SPIRESTeX':
671            return field['z']
672    return ''
673
674def has_texkey_p(record):
675    """Given a BibFormatObject, outputs True if it has a SPIRES TeXkey"""
676    return get_texkey(record) != ''
677
678def has_no_texkey_p(x):
679    """Given a BibFormatObject, outputs False if it has a SPIRES TeXkey"""
680    return not has_texkey_p(x)
681
682def first_word_not_the(s):
683    """Return the first word that's not 'the' in 's', lowercased."""
684    return [w for w in s.lower().split() if w != 'the'].pop(0)
685
686def extract_collaboration(record):
687    """Extract the first word of a collaboration's name or empty string"""
688    return first_word_not_the(record.field('710__g'))
689
690def extract_firstauthor(record):
691    """Extract the last name of the first author, or empty string"""
692    return record.field('100__a').split(',').pop(0)
693
694def str_upto(s, n):
695    """Take up to n chars in s, or else all of it"""
696    if len(s) >= n:
697        return s[:n]
698    else: return s
699
700def extract_title_n(record, n):
701    """Extract the first n non-whitespace characters in the title, lowercased"""
702    return str_upto(''.join(record.field('245__a').split()).lower(), n)
703
704def srs_and_sms(n):
705    """Generate a short random string up to n characters long; email complaint."""
706    # XXX: send email complaining that the metadata is inadequate
707    return 'qqq'+''.join(sample(alphabet, n)) # qqq prefix aids later discoverability
708
709def extract_random_n(n):
710    """'Extract' n random characters, prefixed by 'qqq'"""
711    return srs_and_sms(n)
712
713def extract_date_year(record):
714    """Extract the record's year or else empty string"""
715    return record.field('269__c').split('-').pop(0)
716
717def get_unused_endtag(pre_uniq, other_used_endtags=[]):
718    """Count up in base-26 from aa to find an unused tag"""
719    used_vals = [x[-2:] for x in [BibFormatObject(x).fields('035__z').pop() for x in perform_request_search(p=pre_uniq+'%', f='035__z')]]
720    used_vals.extend([int(x, 36) for x in other_used_endtags])
721    i = B36Int('aa') 
722    while int(i) in used_vals:
723        i.increase()
724        continue
725    return str(i)
726
727def assign_texkey(record, already_taken=[]):
728    """Assign SPIRESTeX Key (035z) to a record, iff it doesn't have one.
729       
730    already_taken is an optional list of strings of length >= 2 which indicate
731    texkeys which may not be generated.
732    """
733    length = 8
734    if has_texkey_p(record): return record
735    auth_part = extract_collaboration(record) or extract_firstauthor(record) or extract_title_n(record, length) or extract_random_n(length)
736    date_part = extract_date_year(record) or str(date.today().year)
737    pre_uniq = auth_part + ':' + date_part
738    # be even more parsimonious than the promise above - ensuring we keep our promise
739    uniq_part = get_unused_endtag(pre_uniq, [x[-2:] for x in already_taken])
740    bibrecord.record_add_field(record.record, '035', ' ', ' ', subfields=[('9', 'SPIRESTeX'), ('z', pre_uniq+uniq_part)])
741    return record
742
743
744def test_assign_texkey(tests):
745    """Given pretest/data/posttest triples, run assign_texkey on data
746       
747       pre and post are closures which accept a data object and contain
748       the rest of their own universe.
749    """
750    for name, marcxml, pre, post in tests:
751        # process data into record thing that can be passed around
752        record = BibFormatObject(recID=None, xml_record=marcxml)
753        if not pre(record):
754            print name + ' FAIL! on precondition'
755            continue
756        record = assign_texkey(record)
757        if post(record):
758            print name + '...OK'
759            continue
760        print name + ' FAIL! on postcondition'
761
762def test_matching_metadata_unique_texkey(a, b):
763    """Generate texkeys for a and b and see if they are similar but different."""
764    a_bfo = BibFormatObject(recID=None, xml_record=a)
765    b_bfo = BibFormatObject(recID=None, xml_record=b)
766    assert(has_no_texkey_p(a_bfo))
767    assert(has_no_texkey_p(b_bfo))
768    a_bfo = assign_texkey(a_bfo)
769    b_bfo = assign_texkey(b_bfo, [get_texkey(a_bfo)])
770    assert(get_texkey(a_bfo) != get_texkey(b_bfo))
771    assert(get_texkey(a_bfo)[:-2] == get_texkey(b_bfo)[:-2])
772    print "Different records with identical metadata produce different, but similar, texkeys... OK!"
773
774def get_test_texkey_matches(regexp):
775    """Return a function which checks whether a BibFormatObject matches a regexp"""
776    regexp = re.compile(regexp)
777    def check(record):
778        debug_print(get_texkey(record))
779        if has_no_texkey_p(record): 
780            return False
781        m = regexp.match(get_texkey(record))
782        return m != None
783    return check
784
785
786test_assign_texkey([
787        ('test should pass', test_record_minimal, lambda x: True, lambda x: True),
788        ('test should fails', test_record_minimal, lambda x: False, lambda x: True),
789        ('test existing texkey', test_record_valid_texkey, has_texkey_p, has_texkey_p),
790        ('test title only gets texkey', test_record_no_texkey_no_date_no_author_no_collaboration, has_no_texkey_p, has_texkey_p), # FIXME: confirm texkey randomness
791        ('test no metadata gets texkey', test_record_no_texkey_no_date_no_author_no_collaboration_no_title, has_no_texkey_p, get_test_texkey_matches('qqq[a-z]{8}:[0-9]{4}[a-z][0-9a-z]')), 
792        ('test date only', test_record_no_texkey_yes_date_no_author_no_collaboration, has_no_texkey_p, get_test_texkey_matches('arenorma:2009[0-9a-z][a-z]')), 
793        ('test date and collab', test_record_no_texkey_yes_date_no_author_yes_collaboration, has_no_texkey_p, get_test_texkey_matches('intentionally broken test - fix it by figuring out why it passes when it shouldnt then fixing that')), 
794        ('test date and author', test_record_no_texkey_yes_date_yes_author_no_collaboration, has_no_texkey_p, has_texkey_p), # FIXME: confirm texkey date, author
795        ])
796
797test_matching_metadata_unique_texkey(test_record_no_texkey_metadata_match_a, test_record_no_texkey_metadata_match_b)
798
799t = get_test_texkey_matches('qqq[a-z]{8}:[0-9]{4}[a-z][0-9a-z]')
800print t(assign_texkey(BibFormatObject(recID=None, xml_record=test_record_no_texkey_no_date_no_author_no_collaboration_no_title)))