]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
cone/schur.py: use generator expressions where applicable.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 4 Nov 2018 04:36:07 +0000 (00:36 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 4 Nov 2018 04:36:07 +0000 (00:36 -0400)
mjo/cone/schur.py

index 3903b2bc8e346aa824c93d5acb14ad5efa6613de..d1bad98bb2b6b2a8f5be968efd29e0c79cf9f1fb 100644 (file)
@@ -40,9 +40,9 @@ def schur_cone(n):
 
         sage: P = schur_cone(5)
         sage: Q = nonnegative_orthant(5)
-        sage: G = [ g.change_ring(QQbar).normalized() for g in P ]
-        sage: H = [ h.change_ring(QQbar).normalized() for h in Q ]
-        sage: actual = max([arccos(u.inner_product(v)) for u in G for v in H])
+        sage: G = ( g.change_ring(QQbar).normalized() for g in P )
+        sage: H = ( h.change_ring(QQbar).normalized() for h in Q )
+        sage: actual = max(arccos(u.inner_product(v)) for u in G for v in H)
         sage: expected = 3*pi/4
         sage: abs(actual - expected).n() < 1e-12
         True