[Xy-pic] Fw: Xy-pic and Qcircuit

Ross Moore ross.moore at mq.edu.au
Thu Mar 10 04:17:07 CET 2011


Hi all,

On 10/03/2011, at 11:03 AM, Kristoffer H Rose wrote:

> Dear Everyone, 
> 
> In the message below, Bryan reports that Xy-pic 3.8 has problems with diagrams generated from Qcircuit.  Since we have a maintenance release coming up (3.8.6 with Daniel's xypdf 1.7), any help with a quick solution from anyone who has experienced similar problems would be most welcome! 
> 
> Bryan and Steve: if you can submit a complete TeX document to the list (as .tex and .pdf attachments), which, when typeset, explains and demonstrates the problem then that will probably facilitate a solution. 

Yes.
Please provide explicit examples using Qcircuit ...

> 
> Thanks to all, 
>         Kris 


> I've tried to isolate what's going wrong, and I think I've identified
> all of the problems (Roughly.  I don't know enough to dig around
> inside Xy-pic.).  I'm not sure if these are bugs in the new release or
> intentional changes, but I've catalogued the issues at the end of this
> email.

I can reproduce *only one* of those errors that you state.
But that example was using a syntax for frames that is not documented 
within the Xy-pic reference manual. So you are rather lucky (or is it
really unlucky?) that it worked at all, in any circumstance.
More on this below.

My testing was on a Mac, both *with* and *without* the new PDF support,
and also with the older  dvips+PostScript backend.

> 
> If they're bugs then please consider this a bug report and a heartfelt
> request for some kind of fix.  If they're not bugs I would be very
> grateful for any advice on how I might circumvent these features.

I'd be more than happy to do so, if I could reproduce them.
For the case of framing an object of zero size, your syntax
was actually undocumented. With the correct documented syntax 
there is not a problem at all.



In the other cases, my best guess is that you somehow are mixing
some files from an earlier version of Xy-pic with those of a 
later version.

Either that, or I have already implemented fixes which you have not
yet been made aware of. But I'd thought that we have released all
the fixes that relate to these examples. Maybe I'm wrong about this?

Please put  \listfiles  in the preamble of your tests, and send the
complete  .log  file that results.


> 
> If you're interested in knowing more about Qcircuit, the package has a
> webpage at http://www.cquic.org/Qcircuit/ .  I believe it is presently
> the most commonly used method for typesetting quantum circuits.
> 
> Thank you for your time,
> Bryan Eastin
> 
> [I have CC'd this email to Steven Flammia, the other author of Qcircuit.]
> 
> 
> 
> %The following examples were generated using MikTeX version 2.7 and
> Xy-pic version 2.8.5 on a Windows XP machine.  Not all of these
> problems
> %seem to manifest on machines running TeXLive on Ubuntu or Mac.  Some
> variant of the first issue happens on all systems, though an error
> %message is not always generated.
> 
> %Problem:
> %Cannot draw an arrow to an entry of xymatrix of size 0em.
> %Qcircuit command broken:
> %\Qcircuit
> %Example code:
> \xymatrix @*[o] @*=<0em> {
> & \ar @{-} [0,-1] & \ar @{-} [0,-1]
> }
> %Resultant error message:
> %Xy-pic Warning: division overflow [FixQcircuit:51]
> %
> %! Arithmetic overflow.
> %<recently read> \quotPTK@
> %Hack:
> %Set the default entry size in \xymatrix to .05em.  Smaller sizes
> somehow result in bigger gaps.
> %The hack is undesirable because:
> %Arrows meeting at an empty entry no longer connect.  Important!

The attached image shows what I get when testing this:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot 2011-03-10 at 1.23.32 PM.png
Type: image/png
Size: 71222 bytes
Desc: not available
URL: <http://tug.org/pipermail/xy-pic/attachments/20110310/7166a3c1/attachment-0002.png>
-------------- next part --------------


There is most certainly an arrow/line drawn.


> 
> %Problem:
> %The \frm command no longer works on null objects.
> %Qcircuit command broken:
> %\targ
> %Example code:
> \xy <0em,0em>*+<.8em>\frm{o}\endxy

This I *can* reproduce, using the new PDF option.

However, you are using a syntax that is undocumented.
The *correct* way to make a circular frame of that size is:

   *\frm<.4em>{o}

This *does* work with the new PDF backend.


> %Resultant error message:
> %None.
> %Hack:
> %Insert a very tiny object.
> %E.g., for \targ, use the code {\xy {<0em,0em> \ar @{ - } +<.39em,0em>
> \ar @{ - } -<.39em,0em> \ar @{ - } +<0em,.39em> \ar @{ - }
> -<0em,.39em>},<0em,0em>*{\rule{.01em}{.01em}}*+<.8em>\frm{o}\endxy}
> %The hack is undesirable because:
> %Aside from being inelegant, it requires a change to the original
> code, which has already been widely distributed.  Less important.


I cannot reproduce this next one:

> 
> %Problem:
> %Erratic generation of Division Overflow Errors.
> %Qcircuit command broken:
> %Uncertain.
> %Example code:
> %The following works.
> \xymatrix @*[o] @*=<0.09em> @R=1.7em @C=1em {
> & \ar @{-} [1,1]  \ar @{-} [0,-1] & & *{a} \ar @{-} [0,-1] \\
> & \ar @{-} [-1,1] \ar @{-} [0,-1] & & *{a} \ar @{-} [0,-1]
> }
> %The following doesn't work:
> \xymatrix @*[o] @*=<0.1em> @R=1.7em @C=1em {
> & \ar @{-} [1,1]  \ar @{-} [0,-1] & & *{a} \ar @{-} [0,-1] \\
> & \ar @{-} [-1,1] \ar @{-} [0,-1] & & *{a} \ar @{-} [0,-1]
> }
> %The following works.
> \xymatrix @*[o] @*=<0.11em> @R=1.7em @C=1em {
> & \ar @{-} [1,1]  \ar @{-} [0,-1] & & *{a} \ar @{-} [0,-1] \\
> & \ar @{-} [-1,1] \ar @{-} [0,-1] & & *{a} \ar @{-} [0,-1]
> }
> %Resultant error message:
> %Xy-pic Warning: division overflow [FixQcircuit:82]
> %
> %! Arithmetic overflow.
> %<recently read> \quotPTK@
> %Hack:
> %Use a different number?
> %The hack is undesirable because:
> %I have no idea what will work when or whether a workable alternative
> will always be available.


nor this one:

> 
> %Problem:
> %Arrows connect poorly to empty entries in \xymatrix
> %Qcircuit command broken:
> %\link
> %Example code:
> \xymatrix @*[o] @*=<0.01em> @R=1.7em @C=1em {
> & \ar @{-} [1,1]  \ar @{-} [0,-1] & & \ar @{-} [0,-1] \\
> & \ar @{-} [-1,1] \ar @{-} [0,-1] & & \ar @{-} [0,-1]
> }
> %Resultant error message:
> %None.
> %Hack:
> %Insert a very tiny object.
> %E.g.,
> \xymatrix @*[o] @*=<0.01em> @R=1.7em @C=1em {
> & *{\rule{.01em}{.01em}} \ar @{-} [1,1]  \ar @{-} [0,-1] &
> *{\rule{.01em}{.01em}} & \ar @{-} [0,-1] \\
> & *{\rule{.01em}{.01em}} \ar @{-} [-1,1] \ar @{-} [0,-1] &
> *{\rule{.01em}{.01em}} & \ar @{-} [0,-1]
> }
> %The hack is undesirable because:
> %The connections still don't look quite right.  Moderately important.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot 2011-03-10 at 2.14.54 PM.png
Type: image/png
Size: 106429 bytes
Desc: not available
URL: <http://tug.org/pipermail/xy-pic/attachments/20110310/7166a3c1/attachment-0003.png>
-------------- next part --------------


The extra tiny object makes an imperceptible difference,
in the attached image.




Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross.moore at mq.edu.au 
Mathematics Department                           office: E7A-419      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the xy-pic mailing list