Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in IncidenceStructure.dual_design #16032

Closed
nathanncohen mannequin opened this issue Mar 30, 2014 · 20 comments
Closed

Bug in IncidenceStructure.dual_design #16032

nathanncohen mannequin opened this issue Mar 30, 2014 · 20 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Mar 30, 2014

As the title says.

With some other improvements.

The original code seems to have been written by a mathematician.

Nathann

CC: @dimpase

Component: combinatorics

Author: Nathann Cohen

Branch/Commit: f6da4b7

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/16032

@nathanncohen nathanncohen mannequin added this to the sage-6.2 milestone Mar 30, 2014
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Mar 30, 2014

Branch: u/ncohen/16032

@nathanncohen nathanncohen mannequin added the s: needs review label Mar 30, 2014
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 30, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

fed439etrac #16032: Bug in IncidenceStructure.dual_design

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 30, 2014

Commit: fed439e

@dimpase
Copy link
Member

dimpase commented Mar 30, 2014

comment:3

What is the bug in question?

@dimpase
Copy link
Member

dimpase commented Mar 30, 2014

comment:4

there is a bug in the optional test: the line 422 in incidence_structures.py should be

sage: PP = designs.ProjectiveGeometryDesign(2,1,GF(4,'conway'), algorithm="gap") # optional - gap_design

actually, it's weird that ProjectivePlaneDesign does not known about algorithm= at all.
This is a bug to be fixed, IMHO, perhaps on this ticket...


the patch is:

--- a/src/sage/combinat/designs/incidence_structures.py
+++ b/src/sage/combinat/designs/incidence_structures.py
@@ -419,7 +419,7 @@ class IncidenceStructure(object):
             sage: PP = designs.ProjectivePlaneDesign(4)
             sage: PP.dual_design().is_block_design()
             (True, [2, 21, 5, 1])
-            sage: PP = designs.ProjectivePlaneDesign(4, algorithm="gap") # optional - gap_design
+            sage: PP = designs.ProjectiveGeometryDesign(2,1,GF(4,'conway'), algorithm="gap") # optional - gap_design
             sage: PP.dual_design().is_block_design()                     # optional - gap_design
             (True, [2, 21, 5, 1])

without it, the test

sage -t --long --optional=sage,gap_design src/sage/combinat/designs/incidence_structures.py 

fails.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Mar 31, 2014

comment:5

Yoooooooo !

there is a bug in the optional test: the line 422 in incidence_structures.py should be

sage: PP = designs.ProjectiveGeometryDesign(2,1,GF(4,'conway'), algorithm="gap") # optional - gap_design

Nononono, I meant this "algorithm=gap" to be an argument of the function I tests, i.e. dual_design.

And I rename this gap_design (which is not even the name of a spkg) to gap_packages.

actually, it's weird that ProjectivePlaneDesign does not known about algorithm= at all.
This is a bug to be fixed, IMHO, perhaps on this ticket...

The standard of the bugs I fix is MUCH higher than the bugs that are not fixed in combinat, really. If THIS is a bug their code should not even be allowed to run :-P

without it, the test

sage -t --long --optional=sage,gap_design src/sage/combinat/designs/incidence_structures.py 

fails.

Well, as I said above the "algorithm=gap" was intended for the dual_block method. I don't see why we would call gap to compute a dual, but anyway :-P

Aaaaaaaaaaaaaand I added this algorithm argument in ProjectivePlane too.

Nathann

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 31, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

f82b15dtrac #16032: reviewer's remarks

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 31, 2014

Changed commit from fed439e to f82b15d

@dimpase
Copy link
Member

dimpase commented Mar 31, 2014

comment:7

OK!

@dimpase
Copy link
Member

dimpase commented Mar 31, 2014

Reviewer: Dima Pasechnik

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Mar 31, 2014

comment:8

You don't mind my removing this "if", do you ? :-PPPPP

Nathann

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 31, 2014

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

7dcff95trac 16032: This can be simplified... :-P

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 31, 2014

Changed commit from f82b15d to 7dcff95

@dimpase
Copy link
Member

dimpase commented Mar 31, 2014

comment:10

shouldn't these matrices be created sparse?

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Mar 31, 2014

comment:11

Ahahaha. Yes of course. Do I change that ?

This code is awful, I am already happy to see those two "for" reverted in order to avoid a useless test. Mathematicians should not write code, all they care about is whether the code can be read like a mathematical proof, and efficiency can go to hell.

Nathann

@dimpase
Copy link
Member

dimpase commented Mar 31, 2014

comment:12

Replying to @nathanncohen:

Ahahaha. Yes of course. Do I change that ?

yes please...

This code is awful, I am already happy to see those two "for" reverted in order to avoid a useless test. Mathematicians should not write code, all they care about is whether the code can be read like a mathematical proof, and efficiency can go to hell.

they can be taught to write good code, IMHO :)

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Mar 31, 2014

comment:13

Yooooooo !

yes please...

Done !

they can be taught to write good code, IMHO :)

Probably. But most of your efforts will be wasted, and in the meantime you have to re-do the work when they turn their back.

Nathann

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 31, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

f6da4b7trac #16032: These matrices should be sparse

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 31, 2014

Changed commit from 7dcff95 to f6da4b7

@vbraun
Copy link
Member

vbraun commented Mar 31, 2014

Changed branch from u/ncohen/16032 to f6da4b7

@vbraun vbraun closed this as completed in d4d9b99 Mar 31, 2014
tscrim pushed a commit to tscrim/sage that referenced this issue Jun 1, 2023
* develop: (155 commits)
  Updated Sage version to 6.2.beta6
  32-bit fix
  typo fixing
  fix int/long doctest
  trac sagemath#16032: These matrices should be sparse
  trac 16032: This can be simplified... :-P
  Correct typo in sage/symbolic/ring.pyx.
  Put comment in the code and add more examples.
  trac sagemath#16032: reviewer's remarks
  FiniteStateMachine.__add__ is the same as __or__
  trac sagemath#16032: Bug in IncidenceStructure.dual_design
  final edits
  more changes -- please check if I got your algorithm right, Travis
  Review changes from Ben.
  further optimizations
  Fixed KR doctest and documentation of q_dimension.
  Fixes for q-dims for general highest weight crystals.
  more optimizations
  Partial work for general HW crystals.
  Review changes and (minor) optimizations.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants