instance_id stringlengths 18 32 | text stringlengths 13.1k 63.9k | repo stringclasses 11
values | base_commit stringlengths 40 40 | problem_statement stringlengths 36 24.8k | hints_text stringlengths 0 38.1k | created_at stringlengths 20 20 | patch stringlengths 302 252k | test_patch stringlengths 347 33.9k | version stringclasses 55
values | FAIL_TO_PASS stringlengths 12 95.7k | PASS_TO_PASS stringlengths 2 271k | environment_setup_commit stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
sympy__sympy-19254 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
sympy.polys.factortools.dmp_zz_mignotte_bound improvement
The method `dup_zz_mignotte_bound(f, K)` can be significantly improved by using the **Knuth-Cohen bound** instead. After our research with Prof. Ag.Akri... | sympy/sympy | e0ef1da13e2ab2a77866c05246f73c871ca9388c | sympy.polys.factortools.dmp_zz_mignotte_bound improvement
The method `dup_zz_mignotte_bound(f, K)` can be significantly improved by using the **Knuth-Cohen bound** instead. After our research with Prof. Ag.Akritas we have implemented the Knuth-Cohen bound among others, and compare them among dozens of polynomials with ... | 2020-05-04T13:38:13Z | <patch>
diff --git a/sympy/polys/factortools.py b/sympy/polys/factortools.py
--- a/sympy/polys/factortools.py
+++ b/sympy/polys/factortools.py
@@ -124,13 +124,64 @@ def dmp_trial_division(f, factors, u, K):
def dup_zz_mignotte_bound(f, K):
- """Mignotte bound for univariate polynomials in `K[x]`. """
- a = d... | diff --git a/sympy/polys/tests/test_factortools.py b/sympy/polys/tests/test_factortools.py
--- a/sympy/polys/tests/test_factortools.py
+++ b/sympy/polys/tests/test_factortools.py
@@ -27,7 +27,8 @@ def test_dmp_trial_division():
def test_dup_zz_mignotte_bound():
R, x = ring("x", ZZ)
- assert R.dup_zz_mignotte... | 1.7 | ["test_dup_zz_mignotte_bound"] | ["test_dup_trial_division", "test_dmp_trial_division", "test_dmp_zz_mignotte_bound", "test_dup_zz_hensel_step", "test_dup_zz_hensel_lift", "test_dup_zz_irreducible_p", "test_dup_cyclotomic_p", "test_dup_zz_cyclotomic_poly", "test_dup_zz_cyclotomic_factor", "test_dup_zz_factor", "test_dmp_zz_wang", "test_issue_6355", "t... | cffd4e0f86fefd4802349a9f9b19ed70934ea354 | |
sympy__sympy-19346 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
srepr not printing dict and set properly
`srepr` prints the element in `list` and `tuple` correctly.
```python
>>> from sympy import srepr
>>> from sympy.abc import x,y
>>> srepr([x,y])
[Symbol('x'), Symbo... | sympy/sympy | 94fb720696f5f5d12bad8bc813699fd696afd2fb | srepr not printing dict and set properly
`srepr` prints the element in `list` and `tuple` correctly.
```python
>>> from sympy import srepr
>>> from sympy.abc import x,y
>>> srepr([x,y])
[Symbol('x'), Symbol('y')]
>>> srepr((x,y))
(Symbol('x'), Symbol('y'))
```
However, `srepr` prints the elements in `dict` a... | 2020-05-17T12:23:33Z | <patch>
diff --git a/sympy/printing/repr.py b/sympy/printing/repr.py
--- a/sympy/printing/repr.py
+++ b/sympy/printing/repr.py
@@ -144,6 +144,16 @@ def _print_EmptySequence(self, expr):
def _print_list(self, expr):
return "[%s]" % self.reprify(expr, ", ")
+ def _print_dict(self, expr):
+ sep =... | diff --git a/sympy/printing/tests/test_repr.py b/sympy/printing/tests/test_repr.py
--- a/sympy/printing/tests/test_repr.py
+++ b/sympy/printing/tests/test_repr.py
@@ -318,3 +318,26 @@ def test_diffgeom():
assert srepr(rect) == "CoordSystem('rect', Patch('P', Manifold('M', 2)), ('rect_0', 'rect_1'))"
b = BaseS... | 1.7 | ["test_dict"] | ["test_printmethod", "test_more_than_255_args_issue_10259", "test_Function", "test_Geometry", "test_Singletons", "test_Integer", "test_list", "test_Matrix", "test_empty_Matrix", "test_Rational", "test_Float", "test_Symbol", "test_Symbol_two_assumptions", "test_Symbol_no_special_commutative_treatment", "test_Wild", "tes... | cffd4e0f86fefd4802349a9f9b19ed70934ea354 | |
sympy__sympy-19713 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
GeneratorsError raised when creating element of fraction field of polynomial ring
I see this construction is not possible
```python3
>>> from sympy import *
>>> a, b, x = symbols('a b x')
>>> domain = ZZ[a,... | sympy/sympy | b1078cd096aa891ebadf5d941ab83268f8b03a80 | GeneratorsError raised when creating element of fraction field of polynomial ring
I see this construction is not possible
```python3
>>> from sympy import *
>>> a, b, x = symbols('a b x')
>>> domain = ZZ[a, b][x].get_field()
>>> domain.field(a+b)
sympy.polys.polyerrors.GeneratorsError: unable to drop generators
... | 2020-07-05T15:09:15Z | <patch>
diff --git a/sympy/polys/fields.py b/sympy/polys/fields.py
--- a/sympy/polys/fields.py
+++ b/sympy/polys/fields.py
@@ -190,11 +190,27 @@ def field_new(self, element):
if isinstance(element, FracElement):
if self == element.field:
return element
+
+ if isinstance... | diff --git a/sympy/polys/tests/test_fields.py b/sympy/polys/tests/test_fields.py
--- a/sympy/polys/tests/test_fields.py
+++ b/sympy/polys/tests/test_fields.py
@@ -137,6 +137,33 @@ def test_FracElement_from_expr():
FracElement)
+def test_FracField_nested():
+ a, b, x = symbols('a b x')
+ F1 = ZZ.frac_... | 1.7 | ["test_FracField_nested"] | ["test_FracField___init__", "test_FracField___hash__", "test_FracField___eq__", "test_sfield", "test_FracElement___hash__", "test_FracElement_copy", "test_FracElement_as_expr", "test_FracElement_from_expr", "test_FracElement__lt_le_gt_ge__", "test_FracElement___neg__", "test_FracElement___add__", "test_FracElement___su... | cffd4e0f86fefd4802349a9f9b19ed70934ea354 | |
sympy__sympy-19783 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Dagger() * IdentityOperator() is not simplified
As discussed on the mailing list the following does not work.
```
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.operator import Op... | sympy/sympy | 586a43201d0357e92e8c93548d69a9f42bf548f4 | Dagger() * IdentityOperator() is not simplified
As discussed on the mailing list the following does not work.
```
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.operator import Operator
from sympy.physics.quantum import IdentityOperator
A = Operators('A')
Identity = IdentityOperator()
... | 2020-07-16T09:40:38Z | <patch>
diff --git a/sympy/physics/quantum/dagger.py b/sympy/physics/quantum/dagger.py
--- a/sympy/physics/quantum/dagger.py
+++ b/sympy/physics/quantum/dagger.py
@@ -1,8 +1,6 @@
"""Hermitian conjugation."""
-from __future__ import print_function, division
-
-from sympy.core import Expr
+from sympy.core import Expr,... | diff --git a/sympy/physics/quantum/tests/test_dagger.py b/sympy/physics/quantum/tests/test_dagger.py
--- a/sympy/physics/quantum/tests/test_dagger.py
+++ b/sympy/physics/quantum/tests/test_dagger.py
@@ -1,8 +1,9 @@
-from sympy import I, Matrix, symbols, conjugate, Expr, Integer
+from sympy import I, Matrix, symbols, co... | 1.7 | ["test_dagger_mul", "test_identity"] | ["test_scalars", "test_matrix", "test_eval_adjoint", "test_operator", "test_operator_inv", "test_hermitian", "test_unitary", "test_outer_product", "test_operator_dagger"] | cffd4e0f86fefd4802349a9f9b19ed70934ea354 | |
sympy__sympy-20049 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Point.vel() should calculate the velocity if possible
If you specify the orientation of two reference frames and then ask for the angular velocity between the two reference frames the angular velocity will be c... | sympy/sympy | d57aaf064041fe52c0fa357639b069100f8b28e1 | Point.vel() should calculate the velocity if possible
If you specify the orientation of two reference frames and then ask for the angular velocity between the two reference frames the angular velocity will be calculated. But if you try to do the same thing with velocities, this doesn't work. See below:
```
In [1]: ... | Hi @moorepants, I think I could fix this. It would be implemented as a part of `ReferenceFrame` in `sympy/physics/vector/frame.py`, right?
No, it is part of Point. There are some nuances here and likely not a trivial PR to tackle. I'd recommend some simpler ones first if you are new to sympy and dynamics.
Sure, underst... | 2020-09-05T09:37:44Z | <patch>
diff --git a/sympy/physics/vector/point.py b/sympy/physics/vector/point.py
--- a/sympy/physics/vector/point.py
+++ b/sympy/physics/vector/point.py
@@ -483,19 +483,49 @@ def vel(self, frame):
Examples
========
- >>> from sympy.physics.vector import Point, ReferenceFrame
+ >>> fr... | diff --git a/sympy/physics/vector/tests/test_point.py b/sympy/physics/vector/tests/test_point.py
--- a/sympy/physics/vector/tests/test_point.py
+++ b/sympy/physics/vector/tests/test_point.py
@@ -126,3 +126,107 @@ def test_point_partial_velocity():
assert p.partial_velocity(N, u1) == A.x
assert p.partial_veloc... | 1.7 | ["test_auto_point_vel", "test_auto_point_vel_multiple_point_path", "test_auto_vel_dont_overwrite", "test_auto_point_vel_shortest_path"] | ["test_point_v1pt_theorys", "test_point_a1pt_theorys", "test_point_v2pt_theorys", "test_point_a2pt_theorys", "test_point_funcs", "test_point_pos", "test_point_partial_velocity", "test_point_vel", "test_auto_point_vel_if_tree_has_vel_but_inappropriate_pos_vector"] | cffd4e0f86fefd4802349a9f9b19ed70934ea354 |
sympy__sympy-20131 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Warn the user when trees of points or trees of reference frames are not self consistent.
sympy.physics.vector has Point and ReferenceFrame. These can be positioned and oriented relative to objects of their same... | sympy/sympy | 706007ca2fe279020e099d36dd1db0e33123ac4c | Warn the user when trees of points or trees of reference frames are not self consistent.
sympy.physics.vector has Point and ReferenceFrame. These can be positioned and oriented relative to objects of their same type, respectively. The user is expected to define relative positions and orientations in a consistent manner... | If we have multiple points defined at a same level , currently automated velocity would choose the point which comes first, but what I suggest is that we calculate all possible velocities of shortest path by and update _vel_dict by a dictionary
p._vel_dict[frame] = { point1 : calculated_velocity, point2 : calc_veloc... | 2020-09-22T12:39:33Z | <patch>
diff --git a/sympy/physics/vector/point.py b/sympy/physics/vector/point.py
--- a/sympy/physics/vector/point.py
+++ b/sympy/physics/vector/point.py
@@ -1,6 +1,7 @@
from __future__ import print_function, division
from .vector import Vector, _check_vector
from .frame import _check_frame
+from warnings import wa... | diff --git a/sympy/physics/vector/tests/test_point.py b/sympy/physics/vector/tests/test_point.py
--- a/sympy/physics/vector/tests/test_point.py
+++ b/sympy/physics/vector/tests/test_point.py
@@ -1,6 +1,6 @@
from sympy.physics.vector import dynamicsymbols, Point, ReferenceFrame
-from sympy.testing.pytest import raises
... | 1.7 | ["test_auto_point_vel_multiple_paths_warning_arises", "test_auto_vel_cyclic_warning_arises", "test_auto_vel_cyclic_warning_msg"] | ["test_point_v1pt_theorys", "test_point_a1pt_theorys", "test_point_v2pt_theorys", "test_point_a2pt_theorys", "test_point_funcs", "test_point_pos", "test_point_partial_velocity", "test_point_vel", "test_auto_point_vel", "test_auto_point_vel_multiple_point_path", "test_auto_vel_dont_overwrite", "test_auto_point_vel_if_tr... | cffd4e0f86fefd4802349a9f9b19ed70934ea354 |
sympy__sympy-20169 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Lens makers formula
Currently lens maker formula is limited to thin lens.
It should also work for plano- lenses(plano-concave and plano convex) and thick lens.
</issue>
<code>
[start of README.md]
1 # SymPy
2... | sympy/sympy | 706007ca2fe279020e099d36dd1db0e33123ac4c | Lens makers formula
Currently lens maker formula is limited to thin lens.
It should also work for plano- lenses(plano-concave and plano convex) and thick lens.
| 2020-09-30T09:14:32Z | <patch>
diff --git a/sympy/physics/optics/utils.py b/sympy/physics/optics/utils.py
--- a/sympy/physics/optics/utils.py
+++ b/sympy/physics/optics/utils.py
@@ -28,7 +28,7 @@
]
from sympy import Symbol, sympify, sqrt, Matrix, acos, oo, Limit, atan2, asin,\
-cos, sin, tan, I, cancel, pi, Float
+cos, sin, ta... | diff --git a/sympy/physics/optics/tests/test_utils.py b/sympy/physics/optics/tests/test_utils.py
--- a/sympy/physics/optics/tests/test_utils.py
+++ b/sympy/physics/optics/tests/test_utils.py
@@ -16,6 +16,7 @@
ae = lambda a, b, n: comp(a, b, 10**-n)
+
def test_refraction_angle():
n1, n2 = symbols('n1, n2')
... | 1.7 | ["test_lens_makers_formula", "test_lens_makers_formula_thick_lens"] | ["test_refraction_angle", "test_fresnel_coefficients", "test_deviation", "test_brewster_angle", "test_critical_angle", "test_mirror_formula", "test_lens_formula", "test_hyperfocal_distance", "test_transverse_magnification"] | cffd4e0f86fefd4802349a9f9b19ed70934ea354 | |
sympy__sympy-20212 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
0**-oo produces 0, the documentation says it should produce zoo
Using SymPy 1.5.1, evaluate `0**-oo` produces `0`.
The documentation for the Pow class states that it should return `ComplexInfinity`, aka `zoo... | sympy/sympy | a106f4782a9dbe7f8fd16030f15401d977e03ae9 | 0**-oo produces 0, the documentation says it should produce zoo
Using SymPy 1.5.1, evaluate `0**-oo` produces `0`.
The documentation for the Pow class states that it should return `ComplexInfinity`, aka `zoo`
| expr | value | reason |
| :-- | :-- | :--|
| `0**-oo` | `zoo` | This is not strictly true, as 0**oo m... | 2020-10-06T11:34:13Z | <patch>
diff --git a/sympy/core/power.py b/sympy/core/power.py
--- a/sympy/core/power.py
+++ b/sympy/core/power.py
@@ -291,6 +291,8 @@ def __new__(cls, b, e, evaluate=None):
).warn()
if evaluate:
+ if b is S.Zero and e is S.NegativeInfinity:
+ return S.ComplexInfinity
... | diff --git a/sympy/core/tests/test_power.py b/sympy/core/tests/test_power.py
--- a/sympy/core/tests/test_power.py
+++ b/sympy/core/tests/test_power.py
@@ -266,6 +266,9 @@ def test_zero():
assert 0**(2*x*y) == 0**(x*y)
assert 0**(-2*x*y) == S.ComplexInfinity**(x*y)
+ #Test issue 19572
+ assert 0 ** -oo... | 1.7 | ["test_zero"] | ["test_rational", "test_large_rational", "test_negative_real", "test_expand", "test_issue_3449", "test_issue_3866", "test_negative_one", "test_issue_4362", "test_Pow_Expr_args", "test_Pow_signs", "test_power_with_noncommutative_mul_as_base", "test_power_rewrite_exp", "test_pow_as_base_exp", "test_nseries", "test_issue_... | cffd4e0f86fefd4802349a9f9b19ed70934ea354 | |
sympy__sympy-20916 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
pprint unicode does not format subscripts on Greek letters
Good:
[ -t₀⋅w₀ -t₁⋅w₀ -t₂⋅w₀]
Bad:
[ -t₀⋅ω0 -t₁⋅ω0 -t₂⋅ω0]
</issue>
<code>
[start of README.md]
1 # SymPy
2
3 [![pypi versio... | sympy/sympy | 82298df6a51491bfaad0c6d1980e7e3ca808ae93 | pprint unicode does not format subscripts on Greek letters
Good:
[ -t₀⋅w₀ -t₁⋅w₀ -t₂⋅w₀]
Bad:
[ -t₀⋅ω0 -t₁⋅ω0 -t₂⋅ω0]
| Could you provide the code which generates this?
```
import sympy as sp
w=[sp.Symbol(f'w{i}') for i in range(4)]
ω=[sp.Symbol(f'ω{i}') for i in range(4)]
sp.pprint(w) # -> [w₀, w₁, w₂, w₃]
sp.pprint(ω) # -> [ω0, ω1, ω2, ω3]
```
Not sure what the standard syntax is for defining variables with subscripts, but if ... | 2021-02-06T05:44:34Z | <patch>
diff --git a/sympy/printing/conventions.py b/sympy/printing/conventions.py
--- a/sympy/printing/conventions.py
+++ b/sympy/printing/conventions.py
@@ -7,7 +7,7 @@
from collections.abc import Iterable
from sympy import Derivative
-_name_with_digits_p = re.compile(r'^([a-zA-Z]+)([0-9]+)$')
+_name_with_digits_... | diff --git a/sympy/printing/tests/test_conventions.py b/sympy/printing/tests/test_conventions.py
--- a/sympy/printing/tests/test_conventions.py
+++ b/sympy/printing/tests/test_conventions.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
from sympy import symbols, Derivative, Integral, exp, cos, oo, Function
from sympy.f... | 1.8 | ["test_super_sub"] | ["test_requires_partial"] | 3ac1464b8840d5f8b618a654f9fbf09c452fe969 |
sympy__sympy-21271 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Doctest failure in sympy/physics/vector/frame.py
See discussion in #20946.
CC @moorepants
There was a doctest failure but the test was disabled in #20954 to unblock CI. The cause of the failure remains u... | sympy/sympy | 72fa16acc88deae0f7c7a8c2e263eb7b912b97e0 | Doctest failure in sympy/physics/vector/frame.py
See discussion in #20946.
CC @moorepants
There was a doctest failure but the test was disabled in #20954 to unblock CI. The cause of the failure remains unfixed though.
The failure was:
```
$ bin/doctest sympy/physics/vector/
================================... | I can fix this. I want to work on this issue.
I think I found a fix , if I succeed I'll make a PR.
@sidhu1012 What do you think the issue is?
It's worth noting that this passes:
```
bin/doctest sympy/physics/vector/functions.py sympy/physics/vector/frame.py
```
and this fails:
```
bin/doctest sympy/physi... | 2021-04-09T07:15:12Z | <patch>
diff --git a/sympy/physics/vector/frame.py b/sympy/physics/vector/frame.py
--- a/sympy/physics/vector/frame.py
+++ b/sympy/physics/vector/frame.py
@@ -190,9 +190,9 @@ def __init__(self, name, indices=None, latexs=None, variables=None):
self.latex_vecs = latexs
self.name = name
sel... | diff --git a/sympy/physics/vector/tests/test_frame.py b/sympy/physics/vector/tests/test_frame.py
--- a/sympy/physics/vector/tests/test_frame.py
+++ b/sympy/physics/vector/tests/test_frame.py
@@ -471,3 +471,63 @@ def test_orient_quaternion():
B = ReferenceFrame('B')
B.orient_quaternion(A, (0,0,0,0))
asser... | 1.9 | ["test_frame_dict"] | ["test_dict_list", "test_coordinate_vars", "test_ang_vel", "test_dcm", "test_w_diff_dcm1", "test_w_diff_dcm2", "test_orientnew_respects_parent_class", "test_orientnew_respects_input_indices", "test_orientnew_respects_input_latexs", "test_orientnew_respects_input_variables", "test_issue_10348", "test_issue_11503", "test... | f9a6f50ec0c74d935c50a6e9c9b2cb0469570d91 |
sympy__sympy-21286 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
make symbolic Range more canonical
Whereas a Range with numerical args is canonical, the Range containing symbols is not:
```python
>>> [Range(3,j,2) for j in range(4,10)]
[Range(3, 5, 2), Range(3, 5, 2), Ra... | sympy/sympy | 546e10799fe55b3e59dea8fa6b3a6d6e71843d33 | make symbolic Range more canonical
Whereas a Range with numerical args is canonical, the Range containing symbols is not:
```python
>>> [Range(3,j,2) for j in range(4,10)]
[Range(3, 5, 2), Range(3, 5, 2), Range(3, 7, 2), Range(3, 7, 2), Range(3, 9, 2), Range(3, 9, 2)]
vs
>>> [Range(i,i+j,5) for j in range(1,6)... | 2021-04-10T12:15:40Z | <patch>
diff --git a/sympy/sets/fancysets.py b/sympy/sets/fancysets.py
--- a/sympy/sets/fancysets.py
+++ b/sympy/sets/fancysets.py
@@ -6,11 +6,11 @@
from sympy.core.function import Lambda
from sympy.core.logic import fuzzy_not, fuzzy_or, fuzzy_and
from sympy.core.numbers import oo
-from sympy.core.relational import ... | diff --git a/sympy/sets/tests/test_fancysets.py b/sympy/sets/tests/test_fancysets.py
--- a/sympy/sets/tests/test_fancysets.py
+++ b/sympy/sets/tests/test_fancysets.py
@@ -9,7 +9,7 @@
Dummy, floor, And, Eq)
from sympy.utilities.iterables import cartes
from sympy.testing.pytest import XFAIL, raises
... | 1.9 | ["test_Range_set", "test_Range_symbolic"] | ["test_naturals", "test_naturals0", "test_integers", "test_ImageSet", "test_image_is_ImageSet", "test_halfcircle", "test_ImageSet_iterator_not_injective", "test_inf_Range_len", "test_range_range_intersection", "test_range_interval_intersection", "test_range_is_finite_set", "test_Integers_eval_imageset", "test_Range_eva... | f9a6f50ec0c74d935c50a6e9c9b2cb0469570d91 | |
sympy__sympy-21313 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
don't canonicalize imageset based on Float
While writing this [answer](https://stackoverflow.com/a/67053708/1089161) about how to get something resembling a float-version for range to work, I tried to think abo... | sympy/sympy | 546e10799fe55b3e59dea8fa6b3a6d6e71843d33 | don't canonicalize imageset based on Float
While writing this [answer](https://stackoverflow.com/a/67053708/1089161) about how to get something resembling a float-version for range to work, I tried to think about how I would do this in SymPy. Although Floats present their own difficulties, there is canonicalization bei... | 2021-04-13T17:15:18Z | <patch>
diff --git a/sympy/sets/handlers/functions.py b/sympy/sets/handlers/functions.py
--- a/sympy/sets/handlers/functions.py
+++ b/sympy/sets/handlers/functions.py
@@ -1,4 +1,4 @@
-from sympy import Set, symbols, exp, log, S, Wild, Dummy, oo
+from sympy import Set, symbols, exp, log, S, Wild, Dummy, oo, Float
from ... | diff --git a/sympy/sets/tests/test_fancysets.py b/sympy/sets/tests/test_fancysets.py
--- a/sympy/sets/tests/test_fancysets.py
+++ b/sympy/sets/tests/test_fancysets.py
@@ -480,6 +480,9 @@ def test_Integers_eval_imageset():
y = Symbol('y')
L = imageset(x, 2*x + y, S.Integers)
assert y + 4 in L
+ a, b, c... | 1.9 | ["test_Integers_eval_imageset"] | ["test_naturals", "test_naturals0", "test_integers", "test_ImageSet", "test_image_is_ImageSet", "test_halfcircle", "test_ImageSet_iterator_not_injective", "test_inf_Range_len", "test_Range_set", "test_Range_symbolic", "test_range_range_intersection", "test_range_interval_intersection", "test_range_is_finite_set", "test... | f9a6f50ec0c74d935c50a6e9c9b2cb0469570d91 | |
sympy__sympy-21370 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
minpoly fails for complicated algebraic number
Given
```python
res = Add(Mul(Integer(-1), Integer(18056180733916867669618057385293712012382720107596894587107596767914846118945948084295668972348402403101620858... | sympy/sympy | e5e0bfa9d08de736055f338f926327157149b019 | minpoly fails for complicated algebraic number
Given
```python
res = Add(Mul(Integer(-1), Integer(180561807339168676696180573852937120123827201075968945871075967679148461189459480842956689723484024031016208588658753107), Pow(Add(Mul(Integer(-1), Integer(5935800710963656285103500499280281251357501993712627289656985609... | I don't think that `minpoly` can be expected to work reliably with expressions that contain Floats (`RR` is not "exact"). They could be first replaced by Rationals`. Maybe `minpoly` should do that automatically.
It isn't supposed to have floats. I messed up getting the srepr. This is it:
```
res = Add(Mul(Integer(-1)... | 2021-04-22T23:42:22Z | <patch>
diff --git a/sympy/core/exprtools.py b/sympy/core/exprtools.py
--- a/sympy/core/exprtools.py
+++ b/sympy/core/exprtools.py
@@ -363,7 +363,7 @@ def __init__(self, factors=None): # Factors
factors[q] = (factors[q] if q in factors else S.Zero) - factors[f]
factors.pop(f)
... | diff --git a/sympy/core/tests/test_exprtools.py b/sympy/core/tests/test_exprtools.py
--- a/sympy/core/tests/test_exprtools.py
+++ b/sympy/core/tests/test_exprtools.py
@@ -56,6 +56,8 @@ def test_Factors():
assert Factors(-I)*I == Factors()
assert Factors({S.NegativeOne: S(3)})*Factors({S.NegativeOne: S.One, I:... | 1.9 | ["test_Factors", "test_minimal_polynomial", "test_minimal_polynomial_issue_19732"] | ["test_decompose_power", "test_Term", "test_gcd_terms", "test_factor_terms", "test_xreplace", "test_factor_nc", "test_issue_6360", "test_issue_7903", "test_issue_8263", "test_monotonic_sign", "test_minimal_polynomial_hi_prec", "test_minimal_polynomial_sq", "test_minpoly_compose", "test_minpoly_issue_7113", "test_minpol... | f9a6f50ec0c74d935c50a6e9c9b2cb0469570d91 |
sympy__sympy-21476 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
diffgeom.CoordSystem.transform with indirect relation raises KeyError
Below code is a minimal example for an indirect transform via a temporary intermediate coordinate system. `parabolic2D.transform(poloidal)` ... | sympy/sympy | f6b0190377be37f93f5e431951e66b562ef5dc35 | diffgeom.CoordSystem.transform with indirect relation raises KeyError
Below code is a minimal example for an indirect transform via a temporary intermediate coordinate system. `parabolic2D.transform(poloidal)` raises a KeyError.
MWE:
```
"""
2D manifold coordinate systems
"""
import sympy
import sympy.diffgeom... | I started looking into this, I noticed another bug in addition to the type mismatch in the Dijkstra algorithm. Your example only gives the forward transformation from parabolic2D to cartesian2D, so in order to solve `poloidal.transform(parabolic2D)` the `transform `method will need to calculate the inverse transformat... | 2021-05-16T07:53:41Z | <patch>
diff --git a/sympy/diffgeom/diffgeom.py b/sympy/diffgeom/diffgeom.py
--- a/sympy/diffgeom/diffgeom.py
+++ b/sympy/diffgeom/diffgeom.py
@@ -193,8 +193,9 @@ class CoordSystem(Basic):
relations : dict, optional
Key is a tuple of two strings, who are the names of the systems where
- the coord... | diff --git a/sympy/diffgeom/tests/test_diffgeom.py b/sympy/diffgeom/tests/test_diffgeom.py
--- a/sympy/diffgeom/tests/test_diffgeom.py
+++ b/sympy/diffgeom/tests/test_diffgeom.py
@@ -1,10 +1,10 @@
+from sympy.core import Lambda, Symbol, symbols
from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r, R3_c, R3_s, R2_origin
... | 1.9 | ["test_coordsys_transform"] | ["test_R2", "test_R3", "test_point", "test_commutator", "test_differential", "test_products", "test_lie_derivative", "test_intcurve_diffequ", "test_helpers_and_coordinate_dependent", "test_correct_arguments"] | f9a6f50ec0c74d935c50a6e9c9b2cb0469570d91 |
sympy__sympy-21527 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
linsolve fails simple system of two equations
```
import sympy
x,y = sympy.symbols('x, y')
sympy.linsolve([sympy.Eq(y, x), sympy.Eq(y, 0.0215 * x)], (x, y))
>> FiniteSet((0, 0))
sympy.linsolve([sympy.E... | sympy/sympy | 31d469a5335c81ec4a437e36a861945a6b43d916 | linsolve fails simple system of two equations
```
import sympy
x,y = sympy.symbols('x, y')
sympy.linsolve([sympy.Eq(y, x), sympy.Eq(y, 0.0215 * x)], (x, y))
>> FiniteSet((0, 0))
sympy.linsolve([sympy.Eq(y, x), sympy.Eq(y, 0.0216 * x)], (x, y))
>> FiniteSet((-4.07992766242527e+17*y, 1.0*y))
sympy.linsolve([... | It seems that in rref the pivot is not fully cancelled due to a rounding error so e.g. we have something like:
```python
In [1]: M = Matrix([[1.0, 1.0], [3.1, 1.0]])
In [2]: M
Out[2]:
⎡1.0 1.0⎤
⎢ ⎥
⎣3.1 1.0⎦
```
Then one step of row reduction gives:
```python
In [3]: M = Matrix([[1.0, 1.0], [1e-1... | 2021-05-26T23:53:16Z | <patch>
diff --git a/sympy/polys/constructor.py b/sympy/polys/constructor.py
--- a/sympy/polys/constructor.py
+++ b/sympy/polys/constructor.py
@@ -48,7 +48,7 @@ def _construct_simple(coeffs, opt):
float_numbers.append(x)
if y.is_Float:
float_numbers... | diff --git a/sympy/polys/matrices/tests/test_linsolve.py b/sympy/polys/matrices/tests/test_linsolve.py
--- a/sympy/polys/matrices/tests/test_linsolve.py
+++ b/sympy/polys/matrices/tests/test_linsolve.py
@@ -7,7 +7,7 @@
from sympy.testing.pytest import raises
from sympy import S, Eq, I
-from sympy.abc import x, y
+f... | 1.9 | ["test__linsolve_float", "test_construct_domain", "test_Poly__new__"] | ["test__linsolve", "test_complex_exponential", "test_composite_option", "test_precision", "test_Poly_mixed_operations", "test_Poly_from_dict", "test_Poly_from_list", "test_Poly_from_poly", "test_Poly_from_expr", "test_poly_from_domain_element", "test_Poly__args", "test_Poly__gens", "test_Poly_zero", "test_Poly_one", "t... | f9a6f50ec0c74d935c50a6e9c9b2cb0469570d91 |
sympy__sympy-21567 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
`expand_trig` for `csch`, `sech`
Although we have fixed #21365, it should be extended further for `csch, sech`.
The behavior for `csc, sec` was to expand it in denominator with `cos, sin`, so it could be taken... | sympy/sympy | 2ac6f38c7d88bcc4943cdec4644ef26142392147 | `expand_trig` for `csch`, `sech`
Although we have fixed #21365, it should be extended further for `csch, sech`.
The behavior for `csc, sec` was to expand it in denominator with `cos, sin`, so it could be taken as a reference.
```python3
>>> from sympy import *
>>> x, y = symbols('x y')
>>> expand_trig(tanh(x ... | I am working on this issue. I have fixed the problem in the title, but have also realised there is an issue with coth(a+b) as well so I will work that out before sending the pull request. | 2021-06-02T19:05:29Z | <patch>
diff --git a/sympy/functions/elementary/hyperbolic.py b/sympy/functions/elementary/hyperbolic.py
--- a/sympy/functions/elementary/hyperbolic.py
+++ b/sympy/functions/elementary/hyperbolic.py
@@ -10,8 +10,6 @@
from sympy.core.logic import fuzzy_or, fuzzy_and
-
-
def _rewrite_hyperbolics_as_exp(expr):
... | diff --git a/sympy/functions/elementary/tests/test_hyperbolic.py b/sympy/functions/elementary/tests/test_hyperbolic.py
--- a/sympy/functions/elementary/tests/test_hyperbolic.py
+++ b/sympy/functions/elementary/tests/test_hyperbolic.py
@@ -1,7 +1,7 @@
from sympy import (symbols, Symbol, sinh, nan, oo, zoo, pi, asinh, a... | 1.9 | ["test_coth", "test_csch", "test_sech"] | ["test_sinh", "test_sinh_series", "test_sinh_fdiff", "test_cosh", "test_cosh_series", "test_cosh_fdiff", "test_tanh", "test_tanh_series", "test_tanh_fdiff", "test_coth_series", "test_coth_fdiff", "test_csch_series", "test_csch_fdiff", "test_sech_series", "test_sech_fdiff", "test_asinh", "test_asinh_rewrite", "test_asin... | f9a6f50ec0c74d935c50a6e9c9b2cb0469570d91 |
sympy__sympy-22402 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
can `arg` denest?
```python
>>> arg(arg(x))
arg(arg(x)) <-- should it just be arg(x)?
>>> arg(x).is_real
True
```
</issue>
<code>
[start of README.md]
1 # SymPy
2
3 [)
arg(arg(x)) <-- should it just be arg(x)?
>>> arg(x).is_real
True
```
| It can't denest:
```python
In [4]: arg(I)
Out[4]:
π
─
2
In [5]: arg(arg(I))
Out[5]: 0
```
Also it's different for positive and negative inputs:
```python
In [8]: arg(arg(I))
Out[8]: 0
In [9]: arg(arg(-I))
Out[9]: π
```
Can the maximum level before stability be 2?
```python
>>> arg(arg(arg(x)))
a... | 2021-11-01T09:15:12Z | <patch>
diff --git a/sympy/functions/elementary/complexes.py b/sympy/functions/elementary/complexes.py
--- a/sympy/functions/elementary/complexes.py
+++ b/sympy/functions/elementary/complexes.py
@@ -689,15 +689,20 @@ def _eval_rewrite_as_conjugate(self, arg, **kwargs):
class arg(Function):
"""
- returns the ... | diff --git a/sympy/functions/elementary/tests/test_complexes.py b/sympy/functions/elementary/tests/test_complexes.py
--- a/sympy/functions/elementary/tests/test_complexes.py
+++ b/sympy/functions/elementary/tests/test_complexes.py
@@ -608,16 +608,25 @@ def test_arg():
f = Function('f')
assert not arg(f(0) + I... | 1.10 | ["test_arg"] | ["test_re", "test_im", "test_sign", "test_as_real_imag", "test_Abs", "test_Abs_rewrite", "test_Abs_real", "test_Abs_properties", "test_abs", "test_arg_rewrite", "test_adjoint", "test_conjugate", "test_conjugate_transpose", "test_transpose", "test_polarify", "test_unpolarify", "test_issue_4035", "test_issue_3206", "test... | fd40404e72921b9e52a5f9582246e4a6cd96c431 |
sympy__sympy-22969 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Gaussian Optics / Refractive index not considered
Dear sympy maintainers,
please correct me, if I am wrong, but I fear that the beam waist in
class sympy.physics.optics.gaussopt.BeamParameter
is not c... | sympy/sympy | d7bddf4f882fe5887638cf3336e7b2f4e989020b | Gaussian Optics / Refractive index not considered
Dear sympy maintainers,
please correct me, if I am wrong, but I fear that the beam waist in
class sympy.physics.optics.gaussopt.BeamParameter
is not correctly computed.
From the source:
def w_0(self):
"""
The beam waist (minimal radius)... | I don't know the physics so well but you are of course welcome to correct it. Many contributors can help with the sympy aspects but I'm not sure how many would know the physics for this case.
Here the formula implemented is incorrect .This will fix itself once the correct formula is used .The relation between Rayleigh ... | 2022-01-31T05:35:02Z | <patch>
diff --git a/sympy/physics/optics/gaussopt.py b/sympy/physics/optics/gaussopt.py
--- a/sympy/physics/optics/gaussopt.py
+++ b/sympy/physics/optics/gaussopt.py
@@ -487,6 +487,7 @@ class BeamParameter(Expr):
z : the distance to waist, and
w : the waist, or
z_r : the rayleigh range.
+ n : the ref... | diff --git a/sympy/core/tests/test_args.py b/sympy/core/tests/test_args.py
--- a/sympy/core/tests/test_args.py
+++ b/sympy/core/tests/test_args.py
@@ -4912,7 +4912,7 @@ def test_sympy__physics__optics__waves__TWave():
def test_sympy__physics__optics__gaussopt__BeamParameter():
from sympy.physics.optics import B... | 1.11 | ["test_sympy__physics__optics__gaussopt__BeamParameter"] | ["test_all_classes_are_tested", "test_sympy__algebras__quaternion__Quaternion", "test_sympy__assumptions__assume__AppliedPredicate", "test_predicates", "test_sympy__assumptions__assume__UndefinedPredicate", "test_sympy__assumptions__relation__binrel__AppliedBinaryRelation", "test_sympy__assumptions__wrapper__Assumption... | 9a6104eab0ea7ac191a09c24f3e2d79dcd66bda5 |
sympy__sympy-23021 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
decompogen doesn't like Min/Max
```
>>> decompogen(Min(5,x),x)
...
File "sympy\solvers\decompogen.py", line 57, in decompogen
result += [f1] + decompogen(f2, symbol)
File "sympy\solvers\decompogen.... | sympy/sympy | 706ab9045effd9886fcf3efd670644a592931b86 | decompogen doesn't like Min/Max
```
>>> decompogen(Min(5,x),x)
...
File "sympy\solvers\decompogen.py", line 57, in decompogen
result += [f1] + decompogen(f2, symbol)
File "sympy\solvers\decompogen.py", line 57, in decompogen
result += [f1] + decompogen(f2, symbol)
File "sympy\solvers\decompogen.py"... | I want to fix this bug :) May I?
ping @smichr please nudge me in the right direction so I may work on this :)
What are we expecting `>>>decompogen(Max(3, x), x)` to return?
Would it be `[max(3,x)]` ?
The issue still persists on `master`.
:white_check_mark:
Hi, I am the [SymPy bot](https://github.com/sympy/sympy-bo... | 2022-02-05T14:37:33Z | <patch>
diff --git a/sympy/solvers/decompogen.py b/sympy/solvers/decompogen.py
--- a/sympy/solvers/decompogen.py
+++ b/sympy/solvers/decompogen.py
@@ -3,6 +3,7 @@
from sympy.core.singleton import S
from sympy.polys import Poly, decompose
from sympy.utilities.misc import func_name
+from sympy.functions.elementary.mis... | diff --git a/sympy/solvers/tests/test_decompogen.py b/sympy/solvers/tests/test_decompogen.py
--- a/sympy/solvers/tests/test_decompogen.py
+++ b/sympy/solvers/tests/test_decompogen.py
@@ -2,7 +2,7 @@
from sympy.core.symbol import symbols
from sympy.functions.elementary.complexes import Abs
from sympy.functions.elemen... | 1.11 | ["test_decompogen"] | ["test_decompogen_poly"] | 9a6104eab0ea7ac191a09c24f3e2d79dcd66bda5 |
sympy__sympy-23296 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Dimensionless number in exponent not recognized as dimensionless in _collect_factor_and_dimension
The following raises an error:
```python
from sympy import S, exp
from sympy.physics.units import energy, len... | sympy/sympy | 877dfbd11e274899452a2aafc1f7b99a000b9199 | Dimensionless number in exponent not recognized as dimensionless in _collect_factor_and_dimension
The following raises an error:
```python
from sympy import S, exp
from sympy.physics.units import energy, length, mass, time, Quantity
u = Quantity("u")
v = Quantity("v")
SI.set_quantity_dimension(u, energy)
SI.set_... |
:white_check_mark:
Hi, I am the [SymPy bot](https://github.com/sympy/sympy-bot) (v161). I'm here to help you write a release notes entry. Please read the [guide on how to write release notes](https://github.com/sympy/sympy/wiki/Writing-Release-Notes).
Your release notes are in good order.
Here is what the release... | 2022-03-27T11:50:19Z | <patch>
diff --git a/sympy/physics/units/unitsystem.py b/sympy/physics/units/unitsystem.py
--- a/sympy/physics/units/unitsystem.py
+++ b/sympy/physics/units/unitsystem.py
@@ -193,7 +193,7 @@ def _collect_factor_and_dimension(self, expr):
fds = [self._collect_factor_and_dimension(
arg) for ... | diff --git a/sympy/physics/units/tests/test_quantities.py b/sympy/physics/units/tests/test_quantities.py
--- a/sympy/physics/units/tests/test_quantities.py
+++ b/sympy/physics/units/tests/test_quantities.py
@@ -528,6 +528,19 @@ def test_issue_22819():
assert Da.scale_factor == 1.66053906660000e-24
+def test_is... | 1.11 | ["test_issue_20288"] | ["test_str_repr", "test_eq", "test_convert_to", "test_Quantity_definition", "test_abbrev", "test_print", "test_Quantity_eq", "test_add_sub", "test_quantity_abs", "test_check_unit_consistency", "test_mul_div", "test_units", "test_issue_quart", "test_issue_5565", "test_find_unit", "test_Quantity_derivative", "test_quanti... | 9a6104eab0ea7ac191a09c24f3e2d79dcd66bda5 |
sympy__sympy-24455 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
`PermutationGroup.is_cyclic` incorrect on "unnamed" S3
If we construct a group `G` that's isomorphic to S3, but don't use the `SymmetricGroup` function to form it, then `G.is_cyclic` is coming up `True`.
```... | sympy/sympy | 5ee2ecd575818f578961bec7d12aa626d4e78ed5 | `PermutationGroup.is_cyclic` incorrect on "unnamed" S3
If we construct a group `G` that's isomorphic to S3, but don't use the `SymmetricGroup` function to form it, then `G.is_cyclic` is coming up `True`.
```python
In [1]: from sympy.combinatorics import *
In [2]: S3 = SymmetricGroup(3)
In [3]: G = Permutation... | I think that it is best to start by checking that the group is abelian (by calling `is_abelian`, not just looking at `_is_abelian`).
A finite abelian group G is the product of its p-components G(p) for primes p dividing the order n of G. The subgroup G(p) consists of those elements of G whose order is a power of p. ... | 2022-12-31T20:17:57Z | <patch>
diff --git a/sympy/combinatorics/perm_groups.py b/sympy/combinatorics/perm_groups.py
--- a/sympy/combinatorics/perm_groups.py
+++ b/sympy/combinatorics/perm_groups.py
@@ -3219,17 +3219,15 @@ def is_cyclic(self):
self._is_abelian = True
return True
- for p in factors:
-... | diff --git a/sympy/combinatorics/tests/test_perm_groups.py b/sympy/combinatorics/tests/test_perm_groups.py
--- a/sympy/combinatorics/tests/test_perm_groups.py
+++ b/sympy/combinatorics/tests/test_perm_groups.py
@@ -1046,6 +1046,25 @@ def test_cyclic():
assert G.is_cyclic
assert G._is_abelian
+ # Non-abel... | 1.12 | ["test_cyclic"] | ["test_has", "test_generate", "test_order", "test_equality", "test_stabilizer", "test_center", "test_centralizer", "test_coset_rank", "test_coset_factor", "test_orbits", "test_is_normal", "test_eq", "test_derived_subgroup", "test_is_solvable", "test_rubik1", "test_direct_product", "test_orbit_rep", "test_schreier_vecto... | c6cb7c5602fa48034ab1bd43c2347a7e8488f12e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.