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

Add pep8 config, use pep8 in travis #2

Merged
merged 3 commits into from Feb 24, 2015
Merged

Add pep8 config, use pep8 in travis #2

merged 3 commits into from Feb 24, 2015

Conversation

skirpichev
Copy link
Collaborator

also, fix E111-E113 errors:
E111 - indentation is not a multiple of four
E112 - expected an indented block
E113 - unexpected indentation

see sympy/sympy#8538

skirpichev added a commit that referenced this pull request Feb 24, 2015
Add pep8 config, use pep8 in travis
@skirpichev skirpichev merged commit 34c6499 into master Feb 24, 2015
@skirpichev skirpichev deleted the pep8-1 branch February 24, 2015 11:40
@skirpichev skirpichev restored the pep8-1 branch March 11, 2015 18:32
@skirpichev skirpichev deleted the pep8-1 branch March 11, 2015 18:32
@skirpichev skirpichev mentioned this pull request Apr 10, 2015
78 tasks
@skirpichev skirpichev modified the milestone: 0.8.0 Sep 9, 2016
skirpichev added a commit to skirpichev/diofant that referenced this pull request Feb 5, 2017
Thanks for @jksuom for suggestion.

I can't check solution for completeness with Solve/Reduce (too slow
in Mathematica 7 in this case), but it's possible to solve system for
subset of gens by elimination with Groebner bases (ugly version of
the solve_poly_system).  That output is equal to our solution,
except for different ordering.

In[71]:= GroebnerSolve[polys_, gens_, subs_] := Module[
  {p = GroebnerBasis[polys, gens][[1]], pos, newpolys, sub, newgens,
   agens, newsub},
  v = Intersection[Variables@Level[p, -1], gens];
  pos = Position[gens, v[[1]]][[1]];
  If[Length[v] == 1,
   sub = Solve[p == 0, v];
   newpolys = polys /. sub;
   newgens = Drop[gens, pos];
   newsub = Table[Union[subs, sub[[i]]], {i, 1, Length[sub]}];
   If[Length[newgens] > 0,
    Return[Flatten[MapThread[GroebnerSolve[#1, diofant#2, diofant#3] &,
       {newpolys, Table[newgens, {i, 1, Length[sub]}],
        newsub}], 1]],
    Return[newsub]
    ]]]

In[72]:= msolve =
 GroebnerSolve[{a*b + d*e + 1, a*c + d*f + 1,
    b*c + e*f + 1, -a^2 - d^2 + g, -b^2 - e^2 + g, -c^2 - f^2 +
     g}, {a, b, c, d, e, g}, {}] // DeleteDuplicates
Length[%]

Out[72]= {{a -> -Sqrt[-1 - f^2], b -> -Sqrt[-1 - f^2],
  c -> -Sqrt[-1 - f^2], d -> f, e -> f,
  g -> -1}, {a -> Sqrt[-1 - f^2], b -> Sqrt[-1 - f^2],
  c -> Sqrt[-1 - f^2], d -> f, e -> f,
  g -> -1}, {a -> (3 f + Sqrt[3] Sqrt[2 - f^2])/(2 Sqrt[3]),
  b -> 1/2 (-Sqrt[3] f + Sqrt[2 - f^2]), c -> -Sqrt[2 - f^2],
  d -> 1/2 (-f + Sqrt[3] Sqrt[2 - f^2]),
  e -> 1/2 (-f - Sqrt[3] Sqrt[2 - f^2]),
  g -> 2}, {a -> -((3 f + Sqrt[3] Sqrt[2 - f^2])/(2 Sqrt[3])),
  b -> 1/2 (Sqrt[3] f - Sqrt[2 - f^2]), c -> Sqrt[2 - f^2],
  d -> 1/2 (-f + Sqrt[3] Sqrt[2 - f^2]),
  e -> 1/2 (-f - Sqrt[3] Sqrt[2 - f^2]),
  g -> 2}, {a -> (-3 f + Sqrt[3] Sqrt[2 - f^2])/(2 Sqrt[3]),
  b -> 1/2 (Sqrt[3] f + Sqrt[2 - f^2]), c -> -Sqrt[2 - f^2],
  d -> 1/2 (-f - Sqrt[3] Sqrt[2 - f^2]),
  e -> 1/2 (-f + Sqrt[3] Sqrt[2 - f^2]),
  g -> 2}, {a -> -((-3 f + Sqrt[3] Sqrt[2 - f^2])/(2 Sqrt[3])),
  b -> 1/2 (-Sqrt[3] f - Sqrt[2 - f^2]), c -> Sqrt[2 - f^2],
  d -> 1/2 (-f - Sqrt[3] Sqrt[2 - f^2]),
  e -> 1/2 (-f + Sqrt[3] Sqrt[2 - f^2]), g -> 2}}

Out[73]= 6

Closes sympy/sympy#12114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant