Fix formating of a docstring in diffgeom.
Added examples for Hadamard and CNOT gates
Merge pull request #1513 from raoulb/fix_3372

Fix 3372
Removed extra import
Remove capital letters from filename in diffgeom.
Merge pull request #1519 from gdevanla/add_examples

Added examples for Hadamard and CNOT gates
rsolve: Require n to appear in y(n + k).

When trying to match y(n + k), where k is a Wild, make sure that we
exclude n from k, otherwise we have nonsensical situations where n
isn't even appearing in the expression, yet we get a false positive
match, e.g. y(m) matches y(n + k) with k: m - n.
rsolve: Properly call rsolve_hyper.

The syntax for rsolve_hyper has what is named i_part on the right-
hand side of the equality which we are trying to solve. Thus a
minus sign was missing. Fixes issue 3290.
Add XypicDiagramDrawer and start implementing the method draw().

This commit also adds XypicDiagramDrawer to __init__.py.  The method
draw() only places the objects in the Xy-pic grid for now.
XypicDiagramDrawer: Begin typesetting the morphisms.

All morphisms are currently drawn straight, without curving, which
quite often results in ugly overlapping.
XypicDiagramDrawer: Factor out morphism drawing into _draw_morphism.

This commit adds _draw_morphism to keep the method draw() less
cluttered.
XypicDiagramDrawer: Map objects to morphisms in advance.

This commit modifies the method draw to create the mapping between
an object and those morphisms which have this object as domain in
advance, instead of using a function to achieve this mapping.
XypicDiagramDrawer: Add some rudimentary testing code.

These are not proper tests, but rather some printing which serves for
debugging purposes.  This code will be modified later.
XypicDiagramDrawer: Enable _draw_morphism to produced curved horizontal arrows.

This morphism enables _draw_morphism do decide when to draw curved
morphisms, how to curve them, and where to place the label.  This does
not solve the problem of positioning the labels of other morphisms,
however.
XypicDiagramDrawer: Decouple the analysis of morphisms from typesetting.

This commit makes the analysis of morphisms in view of producing the
corresponding string representation a separate stage, which happens
before the actual generation of Xy-pic code.  This allows traversing the
morphisms in any order, as well as modifying the properties of some
morphisms after they have already been analysed.
XypicDiagramDrawer: Also consider those which go into the object.

Previously, _process_morphisms would only consider those morphisms which
came out of the objects to decide on the direction in which to curve
arrows.  This is obviously wrong and this commit fixes the issue.
XypicDiagramDrawer: Sort the morphisms by their length and direction.

Before analysing the morphisms, XypicDiagramDrawer now sorts them such
that horizontal and vertical morphisms between neighbouring objects come
first, then longer horizontal and vertical morphisms, and finally,
diagonal objects.
XypicDiagramDrawer: Fix how sticking out morphisms are collected.

This commit makes it sure that only morphisms which indeed stick out of
the objects between the domain and the codomain of a long morphisms are
counted when deciding in which direction to curve the arrow.
XypicDiagramDrawing: Fix the abuse of the variable name "morphism".

_process_morphism would spoil the value of its argument "morphism" by
reusing this name for looping.  This commit fixes it.
XypicDiagramDrawer: When bending morphisms, fix the positions of affected labels.

Sometimes the bending morphism can pass over a name of another morphism.
This commit fixes the issue for the cases when a bending horizontal
morphism passes through the label of a horizontal morphism which is in
the same row.