Blog de Frédéric

To content | To menu | To search

Tuesday, January 10 2012

Mozilla MathML Project: status report

So here is the usal review of activities in the Mozilla MathML project during the last six months:

  • I finished the work started last summer by Jonathan Hage regarding the implementation of the align attribute on <munder/>, <mover/> and <munderover/> elements (Gecko 12.0).
  • As said in my previous report MathML linking is available again since Firefox 7. However, the context menu still has some issues with MathML3 href. Marco Bonardo and Bill Gianopoulos has continued the work but it is not finished yet. See bug 534968 if you want to help. Boris Zbarsky also fixed a bug with color of visited/unvisited MathML links (Gecko 10.0).
  • Implementation of <maction/> has been cleaned up (Gecko 9.0 and 11.0), in particular the non standard actiontype "restyle" is removed. Masayuki Nakano improved how click events are handled on that element.
  • <mlabeledtr/> is still not implemented but this element becomes more important now that MathJax 2.0 is going to rely on it for equation labeling. Firefox did not display at all such a row, but it has been suggested since a long time to be less strict and to just hide the label instead. That's now done (Gecko 9.0). The bug for a complete implementation is bug 689641.
  • I've mentioned this feature several times in the past, but I finally finished the implementation of right-to-left writing of mathematical formulas (Gecko 12.0). I would like to thank Azzedine Lazrek, Mustapha Eddahibi and Khaled Hosny for their helpful remarks on Arabic notations. Here is an example of formula that should render right to left in Firefox 12:

    ٮ = 1 ص س ٮ

    Any volunteer from the Mozilla Arabic community to try it more deeply and/or write demo pages?

Among future improvements, I can mention code clean up, such as removal of unused MathML atoms by Florian Scholz or a refactoring of attribute parsing that improves conformance against the MathML3 recommendation. I have also started implementation of <mglyph/>. Thanks to discussion with Davide Cervone (the main author of MathJax) I was able to convert MathJax tables for stretchy and large operators into our own format. That means that we will be able to use MathJax fonts which look closer to TeX and thus could improve the rendering of formulas in Firefox. To give an idea, here is a screenshot of the MathML torture test:

MathML torture test with MathJax fonts
Left: TeX rendering
Right: Firefox rendering, with experimental MathJax fonts support

Saturday, August 27 2011

Mozilla MathML Project: status report

More than half a year has passed since my last status report on the MathML project and so I think it is time to provide the latest updates. A lot of pending bugs that I mentioned in previous reports has been fixed. A noticeable exception being support for Arabic mathematics, since people who showed interest on this work could not finally make it. Because Mozilla uses a rapid release process now, the description in this post covers four different versions of Gecko that I indicate in parentheses.

The most exciting thing has been to see contributors getting involved or continuing to work on the MathML project. I would like to thank Bill Gianopoulos for finishing the work on MathML linking and regularly testing all the MathML patches as well as Florian Scholz for starting to work on Gecko and continuing to write MathML documentation. Obviously, I'm also particularly grateful to my intern Jonathan Hage, who has definitely been helpful this summer. I've appreciated the assistance of all the other developers, reviewers, bug reporters and documentation authors and I hope that participation will continue to grow!

Below is a summary of the work accomplished since Firefox 4. I also expect to update the planning for MathML.

  • Stretching of Operators and Mathematical operators
    • Embellished operators are now entirely supported. (Gecko 5.0)
    • The MathML Operator Dictionary has been upgraded to the version proposed in the MathML 3 REC. (Gecko 5.0)
    • The set of XML entity definitions for characters - including many mathematical operators - has been upgraded to follow the corresponding W3C recommendation (Gecko 5.0). I've reported this bug to several other browser authors and hope they will align on this set of definitions. Anyway, for compatibility reasons, I recommend Web authors to directly Unicode characters or their numeric entity references.
    • The Asana-Math font is now usable for stretching mathematical operator (Gecko 7.0) To test it, you may want to modify the font.mathfont-family entry in about:config.

    It would really be interesting to support more mathematical Open Type fonts. If you want to help us, have a look to the preliminary bug to work on (a student wanted to work on this bug as a summer project but was not able to do so...).

  • Linking

    One of the most essential feature of the Web is back in the MathML world! There is still some undergoing work to improve rendering/UI but you can now use links in mathematical formula. Support for the old XLink syntax has been restored but it is recommended to use the new MathML 3 href, that avoids the use of XML namespaces.

  • MathML elements/attributes

    The implementation of mstyle has been fixed (Gecko 6.0). In particular, the mathvariant attribute on a <mstyle/> now applies correctly to its <mi/> descendants. The <math/> element should now be usable as an mstyle (Gecko 8.0). Names for negatives spaces are recognized (Gecko 7.0). There are many other improvements for <mfrac/>, <mfenced/>, <mpadded/>, <mtable/> and <munderover/> including new MathML 3 attributes. As usual, you can read the current status on the MathML project page.

  • MathML Documentation

    The MDN documentation has been expanded and updates have been made to indicate fixes or support for new features. Old MathML demo pages are still being updated and prepared for migration to MDN.

Thursday, April 7 2011

Arabic mathematics in Mathzilla

I have just modified a bit the Mathzilla add-ons to experiment with writing arabic math...

Arabic math in Mathzilla

Saturday, April 2 2011

Mozilla MathML Project: Internship Positions

Update: recruiting closed

Firefox 4 has just been released and it's already time for developers to turn their attention to the next releases. If you are a student, you also have your role to play in order to make Firefox (remain) the best browser! You will find below two subjects for a summer internship in the Mozilla MathML Project. If you are interested, please contact me at fred dot wang at free dot fr. Also, recall that this week you may apply to the Google Summer of Code 2011 program. In particular, I have proposed two additional projects on SVG/MathML clipboard features and improving MathML font support.

Implementing new MathML features in Mozilla's layout engine

MathML 3 - a language for describing mathematical expressions in Web pages - was released as a W3C Recommendation last October, opening new perspectives for sciences on the Web. Mozilla has provided a good MathML support for more than ten years and improvements are still underway. The goal of the internship is to improve support for MathML 2 and to implement new features of MathML 3. You are assumed to have:

  • Good knowledge of Web languages (HTML, CSS, Javascript...). Knowledge of MathML is definitely a plus.
  • Ability to program in C/C++ and basic knowledge of compilation, debugging and revision control tools.

You will start to work on layout bugs of medium difficulty in order to let you time to discover, get and build Mozilla's souce code as well as to get familiar with Mozilla's tracking system, review process, automated tests and documentation. Then, you will implement features requiring a gradually increasing amount of work. For each of them, you are supposed to analyse the problem, submit patches, create non-regression tests and finally write documentation / demos of the new feature implemented.

Quality Assurance and Documentation in the Mozilla MathML project

One interesting feature of Firefox 4 is the possibility to include MathML inside standard HTML pages, which will certainly enable more people to use MathML. Hence there is a need to track missing features and important bugs of Mozilla's MathML implementation as well as to provide good documentation for users. The goal of the internship is to improve the Mozilla MathML documentation and to find & analyse MathML issues in Firefox. You are expected to have:

The work to update MathML documentation has started since last year. You will continue to update former MathML demos and write new documentation pages. You will also try to collect feedback from discussion forums, blogs, etc and test Mozilla's MathML implementation against various test pages including the MathML3 test suite. Finally, you will report new issues to Mozilla's tracking system and do bug triage.

Saturday, March 19 2011

GitHub Repositories

I have started to use GitHub for my part-time job with the MathJax project. Since GitHub makes possible to easily create your own repositories, I have done so for my contributions to the Mozilla project. For people interested, here are the links:

Tuesday, January 4 2011

Recent news on the Mozilla MathML Project

This is an updated description of the activities of the Mozilla MathML Project since the overview I gave half year ago. I have selected four items for which progress have happened (I will not mention old patches that have not changed). I think that many bug fixes and new features are likely to require important changes in the MathML code and I will probably discuss them in a later post.

  • Stretching of Operators and Mathematical Fonts
    Jacques Distler has reported a regression due to changes in the release version of STIX fonts. This regression has been fixed on trunk and hopefully the support for STIX fonts 1.0 is now complete and ready for Firefox 4. We have also received several feedback comments from people complaining of bad rendering, even with STIX fonts installed. Hence I think it is important to recall that the current release still requires the beta version of the STIX fonts (however if someone wants to help, note that it has been proposed to write a patch for old versions...). An easy way to check your installation is to look the stretching of the brace in the example below. a + b + c + d + e and compare with the right images of this blog post. Another test is with radical symbols: they should really stretch, contrary to what can be seen on the screenshot of this old post from hacks.mozilla.org. If you have any problems, then I recommend you to read the documentation on the project page.
  • MathML Project Documentation
    The main contribution in this area has been made by Florian Scholz: he wrote MathML element reference pages on MDN during the Web Standards documentation sprint and has subsequently updated these pages. We are also still working on the migration of documentation from mozilla.org to MDN. We have fixed many markup errors on the demo pages but the work is still not complete and help is welcome...
  • linking
    Let's first recall that MathML2 used XLink and that MathML 3 allows to create a link via an attribute href on a MathML element. These features are currently broken / not implemented in Mozilla, but here is an example for testing: ( a p ) = { 1 if a ( p 1 ) / 2 1 ( mod p ) 1 if a ( p 1 ) / 2 1 ( mod p ) 0 if a 0 ( mod p ) .

    Some patches to restore XLink and add support for href have been written so I hope this issue will be fixed soon.

  • mstyle
    Our implementation of the mstyle element has several bugs, with attributes having no effect on the rendering of children. There is now a set of patches fixing several bugs of this kind. Moreover, a patch allows all the attributes of mstyle on the top-level math element, as specified by MathML 3.

Finally, for people who are interested in testing the MathML improvements, Bill Gianopoulos makes available Testing Builds of Firefox which include several MathML patches.

Friday, December 10 2010

Maximal Subgroup Reduction and HSP over Projective Linear Groups

-- updated the 12th of December.

Among the recent algorithms for the Hidden Subgroup Problem, two are particularly interesting: one to find hidden subgroups of nil-2 groups by Ivanyos, Sanselme and Santha ; and another one to find conjugate stabilizer subgroups of PSL ( 2 , q ) (and also those of the related groups SL ( 2 , q ) and PGL ( 2 , q ) ) by Denney, Moore and Russell. The idea of both algorithms is to reduce the initial problem to a HSP over a group for which we already know an efficient algorithm. However, the former only relies on Fourier Sampling over abelian groups while the latter requires Strong Fourier Sampling over some semidirect products of abelian groups. Also, considering the general approach to HSP that I have described in my Master Project, the technique of the former is only likely to work for solvable groups while the composition series of groups considered in the latter contain non-abelian simple groups... but can their ideas be combined together to get new HSP algorithms?

First, let's recall the concept of quantum hiding functions, which is a key ingredient of the first paper. In general, HSP algorithms use a classical oracle f over G which hides a subgroup H i.e. is constant over each coset of H and takes different values on different cosets. The quantum counterpart of f is implemented by a quantum operator U f which takes g 0 to g f ( g ) . Some HSP algorithms use the so-called Strong Fourier Sampling: we create a uniform superposition of the states g f ( g ) over all g G , apply a Fourier Tranform on the first register and measure it. The idea of quantum hiding functions is to replace U f by any other quantum operator sending g 0 to g Ψ g . In order to make the procedure works, we only need the Ψ g 's to be unit states taking the same value over one coset of H and orthogonal values on different cosets. These states may even change at each sampling.

To solve the general HSP and in particular the difficult case of simple groups, I have proposed maximal subgroup reduction. Basically, the idea is to find a maximal subgroup K containing H (there is always one except in the trivial case H = G , which can be checked directly) using an HSP algorithm over G and thus we reduce the problem to HSP over K . Nevertheless, It is not clear at all how to build an efficient oracle hiding K from an oracle f hiding H : the natural choice for f ( g ) would be something gathering the values of f over all the cosets of H inside the coset g K ... but unfortunately there can be exponentially many of them! Hence, it would maybe help to consider quantum hiding functions instead. For example, the states

Ψ g = 1 K k K f ( g k ) satisfy the expected properties. However it is not clear how to produce Ψ g efficiently and even less without knowing the subgroup K . But it is open whether we can find another method, maybe involving other states Ψ g .

Let's turn our attention to HSP over G = PSL ( 2 , q ) (or the other groups described in the paper of Denney, Moore and Russell) and see whether we can apply a maximal subgroup reduction. Note that the group G acts on the projective line F q { } and thus we can define the stabilizer G a of a point a , which is a maximal subgroup. Now, we assume that the hidden subgroup H is included in some G a and that we have a way to build a quantum function hiding G a from an oracle hiding H . Note that we have the inclusions

G a G G G

The idea of the paper is to restrict an oracle hiding G a to the subgroup G and thus get a HSP over G with hidden subgroup G a G . Now, G is isomorphic to some "friendly" semidirect product of abelian groups and thus the authors are able to determine G a G by Strong Fourier Sampling and thus find the stabilizer G a . Note that their algorithm still works if we use quantum hiding function instead! Hence, with the hypothesis above, we are able to determine a maximal subgroup G a containing H . To complete the algorithm, we need to find the hidden subgroup H of G a G . However, the paper describes only the case of G a G G and I am not sure that the authors mean they have an algorithm for finding arbitrary subgroups of G ...

Another open question: can we generalize this maximal subgroup technique to solve HSP over PSL ( 2 , q ) ? We would like a way to distinguish among exponentially many (maximal) subgroups. Note that the list of (maximal) subgroups of PSL ( 2 , q ) and PGL ( 2 , q ) are known (see Dickson's book). Among the exponentially large subgroups (i.e. for which we would need an efficient HSP algorithm), there are subgroups isomorphic to PSL ( 2 , q 0 ) , PGL ( 2 , q 0 ) or to a semidirect product of a p-group and a cyclic group (including the famous dihedral group!). Note also that PSL ( 2 , q ) is a normal subgroup of PGL ( 2 , q ) , and so we could also imagine the use of a quotient reduction...

Wednesday, December 1 2010

Can transfinite numbers be extended to more general algebraic structures?

Infinite ordinals and cardinals are beautiful mathematical objects, extending in a natural way and sharing most of its properties. I have always wondered whether it would be possible to generalize the constructions of or to get transfinite integers or rationals. In general, putting a group structure on classes extending Ord or Card is not possible as I indicated some years ago (fr). Basically, we would have 1 + 0 = 0 (and also 1 + ω = ω ) which would imply 1 = 0 . However, we can consider a slightly modified problem with weaker constraints, as follows. First we assume we have a class of cardinals C Card containing zero and stable by addition.

(1) { 0 C κ , λ C , κ + λ C

We define the class Z C = C C , where C = { κ κ C , κ 0 } is a representation of "negative" cardinals. As we have seen, the class Z C need not be a group. Nevertheless, we can try to find an equivalence class R over Z C such that G C = Z C R is a group. Moreover, we want this equivalence class to be compatible with addition and opposite i.e.

(2) κ , λ C , κ + λ ¯ = κ ¯ + λ ¯ κ C , κ ¯ = κ ¯

Of course this implies that 0 ¯ is the identity element 0 of the expected group. Similarly, we can settle the same problem for a class C Ord and + is now understood as the ordinal addition. Can we follow this schema to contruct interesting infinite algebraic structures?

For C Card , we have for any infinite κ C the relation κ ¯ = κ + κ ¯ = κ ¯ + κ ¯ so κ ¯ = 0 . Hence G C ω = G C and the initial problem is reduced to the case where C ω contains only finite cardinals (= finite ordinals) and so the problem is still not really exciting. What about the case C Ord ? In general it is possible to have β 1 + γ = β 2 + γ without β 1 , β 2 being equal and so for any α such that β 1 α , β 2 α , γα C , we get that β 1 α ¯ = β 2 α ¯ . In particular for any infinite ordinal γ and α C such that γα C we obtain α ¯ = 0 because 1 + γ = γ (if this is not obvious to you, a more general statement is proved below). As a consequence, more general assumptions on the class C strongly limit the structure of the group. For example if C is closed under an infinite sum ( C = Ord for example) then G C is trivial. Similarly, if we require C to be stable by multiplication (in order to define a ring structure for example) then G C is trivial whenever C contains an infinite ordinal γ (hence the remaining case is again C ω ). If G C is not trivial, we denote α 0 C the least element such that α 0 ¯ 0 (in particular α 0 > 0 ).

One additional natural hypothesis should be added. We know that for any ordinal α < β there exists a unique ordinal γ such that α = β + γ . We would very like γ ¯ to match the difference " β ¯ + α ¯ ". For that purpose, we only require γ to belong to C . Hence we assume that

(3) α , β C , γ Ord , α = β + γ γ C

Let's come back to the case C ω with the new assumption (3) and suppose that G C is not trivial. Then α 0 < ω and any finite m C and be written m = α 0 q + r with r < α 0 . By (3), r C and because C is stable by finite sums, m ¯ = α 0 ¯ q + r ¯ = α 0 ¯ q . Thus G C is the monogenic group generated by α 0 ¯ .

What about the general case? Unfortunately, it turns out that if G C is not trivial it is still a monogenic group generated by α 0 ¯ . To prove this, we need to recall some equalities on ordinals. First, for any α > 0 , we have 1 + ω α = ω α . This is clearly true for α = 1 and we prove the general case by induction on α : 1 + ω α + 1 = 1 + ω ω α = 1 + ( 1 + ω ) ω α = ( 1 + ω α ) + ω α + 1 = ω α + ω α + 1 = ( 1 + ω ) ω α = ω ω α = ω α + 1 and 1 + ω λ = sup 0 < α < λ ( 1 + ω α ) = sup 0 < α < λ ω α = ω λ . Now, if we have two ordinals α < β and if γ > 0 is such that β = α + γ we have ω α + ω β = ω α ( 1 + ω γ ) = ω α ω γ = ω β . Finally, if we have two ordinals γ 1 < γ 2 we can write their Cantor Normal Forms:

(4) γ 1 = ω β 1 1 k 1 1 + ω β 2 1 k 2 1 + + ω β n 1 k n 1 γ 2 = ω β 1 2 k 1 2 + ω β 2 2 k 2 2 + + ω β n 2 k m 2

where β 1 2 β 1 i > β 2 i > > β 2 i and k j i are positive integers. Using the equality ω α + ω β = ω β for α < β it is clear that γ 1 + γ 2 = γ 2 if β 1 2 > β 1 1 .

Now our element α 0 C can be written α 0 = ω β k + γ where ω β k is the first term of its Cantor Normal Form. For any δ C , we can write its euclidean division by α 0 : δ = α 0 l + ε where ε < α 0 . By the previous discussion, if l ω then we can write the Cantor Normal Forms of the two elements α 0 < δ as in (4) and see that β 1 2 > β 1 1 . Hence α 0 + δ = δ and so α 0 ¯ = 0 , which is a contradiction. So l < ω and because C is stable by finite sums, α 0 l C and by the property (3) we get ε C . This means that δ ¯ = α 0 ¯ l + ε ¯ = α 0 ¯ l and hence G C is generated by α 0 ¯ as claimed above.

As a conclusion, if C Card satisfies the properties (1), (2) above and G C = Z C R is a group then C ω Ord . If C Ord satisfies properties (1), (2), (3) above and G C = Z C R is a group then G C is isomorphic to or to n . Conversely, we can build these groups from C = ω by defining the relation R as the equality (respectively the equality modulo n ). But we do not get any new groups...

Saturday, November 27 2010

Ingénieur en informatique / Computer Engineer

J'ai le plaisir d'annoncer que je suis maintenant officiellement ingénieur ENSIIE :-) J'ai aussi mis mon CV en ligne...

I'm pleased to announce that I'm now officially an ENSIIE engineer :-) I've also uploaded my CV/resume...

Saturday, November 20 2010

Exercices in Set theory

New solutions of some exercises from chapter 4 of Thomas Jech's book Set Theory.

Monday, November 15 2010

Mozilla MathML Add-ons

I've released two betas of Mozilla MathML add-ons for trunk builds:

  1. MathParser: mathparser-0.1.xpi (Linux x86_64, 95.7 KB)
  2. Mathzilla: mathzilla-0.1.xpi (168.85 KB)

MathParser adds an XPCOM component to parse mathematical expressions into MathML and should be usable with any Mozilla application. Two modes are available: simple or itex (see part 1 and part 2). Mathzilla is an add-on for Firefox, based on jetpack 0.8. It requires MathParser to be installed and provides the following features that people interested in MathML are likely to appreciate:

  • A tiny MathML editor. It's basically an interface for MathParser, with an input field and a MathML rendering of the output.
  • Conversion of Content MathML, based on David Carlisle's ctop.xsl. A good workaround for bug 276028.
  • Conversion of PNG images into MathML. Of course, this works only on websites that provide the LaTeX source as alt text. In particular, it is usable on Wikipedia and hence allows to workaround Wikimedia's bug 6383.
  • A copy MathML formula item in the context menu. For the moment, I've only tested the text/unicode flavor, so I'm not sure the application/mathml+xml flavor works. See bug 539506 and transferring MathML for more information. Of course, this allows to copy the MathML outputs of the three previous features ;-)

Some screenshots:

MathML Testsuite, testing content markup.
Content Markup of the MathML testsuite transformed into Presentation Markup using ctop.xsl.

Interface of Mathzilla  Parser, LaTeX input.
The interface of the Mathzilla parser, with Unicode-friendly itex input.

MathML formula on Wikipedia.
Wikipedia's page on Fourier series with PNG images transformed into presentation MathML.

Tuesday, October 5 2010

An XPCOM component to parse mathematical expressions into MathML (part 2)

So I'm finally done with the implementation of itex2MML in my mathparser. The current set of patches is available here and can be used in any Mozilla product based on mozilla-central. For those who don't know, itex2MML is a converter from a LaTeX-like syntax to MathML which was originally written, about ten years ago, by Paul Gartside for the Mozilla MathML Project. It has been maintained since then by Jacques Distler, who has made a great work to improve and extend it (and has also reported several bugs that helped us to make our MathML layout engine better ;-). Hence it is a mature tool and it is worth being based on it in order to provide a decent LaTeX-like parser.

You can find a list of itex2MML commands as well as various examples. All itex2MML commands are supported in my mathparser, except inclusion of SVG graphics, XML entities and obsolete maction's commands. There are also some additional features such that support for Unicode characters in the LaTeX input. Below are random demos:

$$\int_M K\;dA+\int_{\partial M}k_g\;ds=2\pi\chi(M), \, $$

M K dA + M k g ds = 2 π χ ( M ) ,

$$\oint_S \mathbf{E} \cdot \mathrm{d}\mathbf{A} = \frac{Q}{\varepsilon_0},$$

S E d A = Q ε 0 ,

$$u = \root{3}{-{q \over 2} \pm \sqrt{{q^2 \over 4} + {p^3 \over 27}}}$$

u = q 2 ± q 2 4 + p 3 27 3

$$\frac{a_0}{2} + \sum_{n=1}^\infty \, [a_n \cos(n x) + b_n \sin(n x)]$$

a 0 2 + n = 1 [ a n cos ( n x ) + b n sin ( n x ) ]

Thursday, September 16 2010

An XPCOM component to parse mathematical expressions into MathML (part 1)

I have started to write a math parser usable by Mozilla-based applications. In particular, this could help to add math editing features to Mozilla's editors (BlueGriffon™, Komposer or Thunderbird etc). Of course, it will also be usable by Mozilla's extensions, such that Firemath. I will probably give more details in subsequent blog posts but the main ideas are given in that one.

First, the parser is usable through classical XPCOM calls. With the current interface, we get something like (in Javascript):

mathparser =
  Components.classes['@mozilla.org/editor/mathparser;1'].
  createInstance(Components.interfaces.nsIMathParser);

node = mathparser.parse(document, input,
  Components.interfaces.nsIMathParser.MATHPARSER_MODE_SIMPLE);

where input is a string representing a mathematical formula and node is the output MathML tree. Note the third parameter of the parse function, which allows to choose a parser mode. For the moment, I have only written one for very basic formulas. However, I plan to add at least a LaTeX-like mode.

As an example, if we provide the following input strings "{∑_{i=1}^{+∞} 1/n^2} = π^2/6" and "{∫_0^{+∞} {ⅆx}/{4(x+1)√x}} = π/4" the parser outputs:

i = 1 + 1 n 2 = π 2 6 0 + x 4 ( x + 1 ) x = π 4

Note that the core engine is produced using the famous parser generator Bison and hence it will be easy to adapt the work of itex2MML. The lexical analyzer is written directly and we get a very nice feature: unicode support! If people are interested, I have some patches applyable to mozilla-central...

Tuesday, September 7 2010

Farvel Danmark, Bonjour Paris.

Så bliver det tre uger siden jeg forlod Århus. Jeg vil gerne take alle for et hyggeligt ophold og jeg håber at vi mødes igen! Jeg regner også med at blive en datalogiingeniør snart. De to næste år, skal jeg læse matematik ved Paris' Universitet. Så hvis i kommer til fransk hovedstad, i er meget velkommen til at besøge mig ;-)

Après une année Erasmus, j'ai finalement terminé ma formation d'ingénieur ENSIIE et espère obtenir mon diplôme bientôt ! Je suis maintenant de retour sur Paris et compte poursuivre ma formation en mathématiques à l'Université Pierre et Marie Curie (Paris VI). Au premier semestre mon choix se porte sur les modules de théorie de Galois et d'analyse réelle. J'envisage aussi de commencer une nouvelle langue parmi allemand, russe ou chinois... affaire à suivre !

Thursday, August 12 2010

Mozilla MathML Project: overview of future improvements and other bugs to fix

In this blog post, I'm going to give an idea of undergoing work in the Mozilla MathML Project. I've also selected a list of MathML bugs that would be interesting to fix in the future. Although I'm not going to give detailed explanations, I hope it will help to see the big picture and maybe bring new contributors to the project.

First, as indicated in the planning for MathML, the two priorities are:

  • Stretching of Operators and Mathematical Fonts

    New rendering, with fonts installedIn mathematical formulas, we need to stretch symbols (such that braces "{" or square roots "√") or to draw large operators (such that sums "∑" or integrals "∫"). The typical way to do that is to use mathematical fonts, which provide glyphs of different sizes or that can be combined together to get a large symbol. Recent work has given a complete support for STIX fonts 1.0. Another method visible in a previous blog post is to apply a scale transform to the symbol. This provides a fallback when STIX fonts are not installed or not sufficient (for example for some accents, triple arrows or large operators). This may even slightly improved the accuracy of the standard stretching. With these two improvements, all the bugs reported by users for stretchy symbols will be fixed in Firefox 4.0.

    In the future, it would be interesting to be able to stretch operators in the diagonal direction as well as inside mtable cells, the combination being particularly useful to draw diagonal arrows. The idea to get a "beautiful" diagonal stretching is to use the current stretching for horizontal/vertical operators, followed by a rotation. There are also two annoying bugs causing stretch failures that are worth fixing.

    For the mathematical fonts, support for Asana-Math font is underway. Support for Cambria Math font would also be nice, because it is installed in recent versions of Windows, Microsoft Office and other Microsoft's products. For both fonts, it is helpful to extract information from the Open MATH Table and it will even improve the rendering of formula beyond stretching. There are also various proposals to inform user of lacking fonts and launch an automated installation.

    Finally, related improvements for operator dictionary, embellished operators, operator forms and large operators are coming in a near future.

  • MathML Project Documentation

    Mozilla writing on blackboardFor quite a long time, the Mozilla MathML Project Page had been lacking maintenance and most pages were outdated. Last April, we started to migrate and update the former project page to developer.mozilla.org. The page Authoring MathML now briefly gives the principal hints to use MathML in XHTML (until we have HTML5) and then presents miscellaneous authoring tools. A more up-to-date Status Page is available and includes new features of MathML 3. Some pages to register our results of MathML3 Testsuite have been prepared but are mostly empty for the moment. Finally, for people willing to contribute to the project, new pages for MathML development are available on wiki.mozilla.org. In particular, one can find there more precise information on the planning for MathML.

    Updating MathML documentation is something for which we could get more help and the migration to wiki pages is likely to make contributions easier. However, this migration is not complete yet. Apart from remaining screenshots and old documentation on fonts, the main problem is that developer.mozilla.org does not allow the use of MathML. Hence, we need to wait MathML-in-HTML5 support on developer.mozilla.org to migrate demo pages. Additionally, we need to fix several errors in the demo pages. Finally, let's mention a seven-years-old bug for which help would be appreciated: translating the MathML start page to Arabic and Chinese.

There are of course many other topics to work on:

Thursday, August 5 2010

Two Open Problems for the Subgroup-Reduction based Dedekindian HSP Algorithm

One of my main idea after having studied the Hidden Subgroup Problem is that subgroup simplification is likely to play an important role. Basically, rather than directly finding the hidden subgroup H by working on the whole initial group G , we only try to get partial information on H in a first time. This information allows us to move to a simpler HSP problem and we can iterate this process until the complete determination of H . Several reductions of this kind exist and I think the sophisticated solution to HSP over 2-nil groups illustrates well how this technique can be efficient.

Using only subgroup reduction, I've been able to design an alternative algorithm for the Dedekindian HSP i.e. over groups that have only normal subgroups. Recall that the standard Dedekindian HSP algorithm is to use Weak Fourier Sampling, measure a polynomial number of representations ρ 1 , , ρ m and then get with high probability the hidden subgroup as the intersection of kernels H = i Ker ρ i . When the group is dedekindian, we always have H Ker ρ i . Hence my alternative algorithm is rather to start by measuring one representation ρ 1 , move the problem to HSP over Ker ρ 1 and iterate this procedure. I've been able to show that we reach the group H after a polynomial number of steps, the idea being that when we measure a non-trivial representation the size of the underlying group becomes at least twice smaller. One difficulty of this approach is to determine the structure of the new group Ker ρ i so that we can work on it. However, for the cyclic case this is determination is trivial and for the abelian case I've used the group decomposition algorithm, based on the cyclic HSP. Finally I've two open questions:

  1. Can my algorithm work for the Hamiltonian HSP i.e. over non-abelian dedekindian groups?
  2. Is my algorithm more efficient than the standard Dedekindian HSP?

For the first question, I'm pretty sure that the answer is positive, but I admit that I've not really thought about it. For the second one, it depends on what we mean by more efficient. The decomposition of the kernel seems to increase the time complexity but since we are working on smaller and smaller groups, we decrease the space complexity. However, if we are only considering the numbers of sample, my conjecture is that both algorithms have the same complexity and more precisely yield the same markov process. In order to illustrate this, let's consider the cyclic case G = 18 and H = 6 18 . The markov chain of the my alternative algorithm is given by the graph below, where the edge labels are of course probabilities and the node labels are the underlying group. We start at G = 18 and want to reach H 3 .

1 Z18 1->1 1/6 2 Z9 1->2 1/6 3 Z6 1->3 1/3 4 Z3 1->4 1/3 2->2 1/3 2->4 2/3 3->3 1/2 3->4 1/2 4->4 1

One can think that moving to smaller and smaller subgroups will be faster than the standard algorithm which always works on 18 . However, it turns out that the markov chain of the standard algorithm is exactly the same. The point being that while it is true that working over 9 or 6 provides less possibilities of samples (3 and 2 respectively, instead of 6 for 18 ) the repartition of "good" and "bad" samples is the same and thus we get the same transition probabilities. I guess it would be possible to formalize this for a general cyclic group. The general abelian case seems more difficult, but I'm sure that the same phenomenon can be observed.

Tuesday, August 3 2010

Spot the difference

Some screenshots to let you compare the rendering of Gecko with or without the recommended fonts installed and discover the improvements on which the Mozilla MathML Team is working...

Version Default Rendering Rendering with recommended fonts
Release Rendering using release Rendering using release with recommended fonts
Future Future Rendering Future Rendering with recommended fonts

Friday, July 30 2010

Master's Project - The Hidden Subgroup Problem

I've submitted my report on The Hidden Subgroup Problem to arXiv.org and I expect it to be published soon.

Comments are welcome on this blog entry.

--update 03/08/2010: a pdf version is available on arXiv.org. You can still find a Web version as well as my slides on my website.

Saturday, July 24 2010

Using Mozilla to print a scientific report based on Web formats

So I'm finally done with my Master's Project in Quantum Computing at Århus. My final report on The Hidden Subgroup Problem is now available in XHTML and pdf formats. There are also the slides I've made for the oral defense, although as always it is not really useful without the comments. This time, I've used the W3C's slidy tool and so my work is 100% based on Web formats :-)

The Hidden Subgroup Problem still remains difficult with our current knowledge, but I've very appreciated thinking on this challenging topic and I hope my work will help research in this area. As an advocate of the Web as a publishing medium for scientists, I've also found a meta-interest in seeing whether it is possible to use Web formats to produce documents readable both on the screen and on the paper (and in this latter case with the same quality as the more traditional methods). One way to do that is to use TeX-like documents and export them in Web/Printing formats using tools such that Tex4ht or GELLMU. Since my personal preference is to write Web contents by a hybrid method (mixing WYSIWYG and simple-syntax-parsers), I've rather considered how one can print these Web formats. One tool to do that is Prince but I'm not sure it is that good with SVG/MathML (there were some issues last time I tried it). Hence I've preferred to use a free layout engine and thus printed my report with Gecko :-).

One of the difficulty is to handle numbering (pages, sections, formulas, theorems...) and the corresponding references (HTML links or page numbers) either in the table of contents or inside the body of the report itself. Moreover, the report has to be split into several small pieces for otherwise it is too large to be edited easily (in my case, 1.1Mb on a single XHTML page for an amount of 99 pages). Hence at the beginning I had to quickly write once and for all an automated system. I'm not really prude of it - it is truly an usine à gaz involving CSS counters, Flex lexical analyzer and a command line print extension for Firefox - but at least it works almost as I expect. Ideally, it should be possible to print each piece separately before grouping them into one single pdf document. However, because of the choice of CSS counters and the lack of control on page numbering in Mozilla I could only print the whole large XHTML document. This was really not convenient and was one of the main annoying issue. The other one being that there is no access to the page numbers and so for the table of contents, I had to write them manually :-(. It seems that a way to overcome the page number issues would be to implement some CSS rules for printing although I don't know if it helps working on separate pieces.

The other problems are various bugs in Gecko. Thanks to the recent improvements in MathML (related to stretchy and fonts) , the mathematical formulas are now displayed with a good quality, or at least one of which I'm satisfied. One issue is the incorrect computation of dimension in mtable which is slightly visible for some split equations. I've also discovered a wrong thickness of bars which seems to be the only difference between print and screen renderings. However, I could workaround it and Karl gave me a hint that would hopefully allow to fix the bug. There are still some annoying bugs with linebreaking within mathematical expressions and around them. For the former I can avoid the problem by adding <mrow/>'s but the latter makes particularly weird effects. Typically, when some comma or period is placed just after an inline formula, a linebreak may happen and move the punctuation symbol to the beginning of the next line... Regarding quantum circuits and other schemas, the SVG code I use is very elementary. Hence I don't have any complaint to formulate, even if I'm among those who are expecting the possibility to use SVG images in the standard <img/> tag. Finally, I have some mysterious bugs with HTML tables printed on several pages and more issues with CSS page breaking, requiring me to do some small manual tweaking at two or three places.

As a conclusion, using Web formats to print a scientific report is not yet so easy. However, I'm quite satisfied of the result and I expect the issues above to be fixed in the near future...

Monday, July 5 2010

Thoughts on the Dihedral Hidden Subgroup Problem (part 3)

Back to the DHSP again (see part 1 and part 2 in previous blog posts)... This time, I've tried to approximate the value of d rather than finding its parity. For convenience, we assume N to be even and define N ' = 2 M = N 2 . We consider for a N and b 2 the sets of N ' successive values F a b = { f ( a + i , b ) , i N }

We suppose that we can efficiently create uniform superposition over these states. As in part 2, we have F a 1 = F a d 0 = F s 0 with N < s < N and we measure the tensor product of the uniform superpositions over F a 1 = F s 0 and F 0 0 in the basis x x x N , 1 2 ( x y + x y ) x < y N , 1 2 ( x y x y ) x < y N . We define l = F 0 0 F a 1 the number of common elements.

f ( 0 , 0 ) f(0,0) f ( N ' , 0 ) f(0,0) f ( N 1 , 0 ) f(0,0) F 0 0 F_0^0 F s 0 F_s^0 s s l l N ' N' 0 s N ' 0 ≤ s ≤ N'

The figure above shows that in the case 0 s N ' , we have l = N ' s . In general, the expression is

l = N ' s = N ' d a

Using an analysis similar to the one part 2, we get the probability to measure an element in 1 2 ( x y x y ) x < y N :

P = 1 2 [ 1 ( l N ) 2 ]

Repeating the measurements, we can approximate P , and consequently l , s and finally d . We can also play with the value a , to improve the approximation. Unfortunately, using a number of repetitions polynomial in log N , it does not seem possible to bound the error better than O ( N ) . It seems however that it is still a better result than the one that I obtained with the standard Coset Sampling method. Hence it is another hint of the fact that using a superposition over several oracles values would yield improvement.

I'm still wondering how to create efficiently an uniform superposition over several oracle values. One thing I've read in many papers, is given a superposition over elements x f ( x ) , erase or uncompute the first register to get a superposition over elements f ( x ) . However, I'm not sure what are the requirements to apply such an operation. If it could work for the algorithm of part 2, then this would solve the case N = 2 n .

- page 1 of 2