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

MPC complex numbers and the symbolic i cannot be added #11808

Open
jpflori opened this issue Sep 16, 2011 · 2 comments
Open

MPC complex numbers and the symbolic i cannot be added #11808

jpflori opened this issue Sep 16, 2011 · 2 comments

Comments

@jpflori
Copy link

jpflori commented Sep 16, 2011

With the current interface to the MPC library, you cannot add the symbolic i and MPC complex numbers:

sage: from sage.rings.complex_mpc import MPComplexField
sage: MPC = MPComplexField()
sage: MPC(1) + SR(i)
Traceback (most recent call last)
...
TypeError: unsupported operand parent(s) for '+':
'Complex Field with 53 bits of precision' and 'Symbolic Ring'
sage: SR(i) + MPC(1)
Traceback (most recent call last)
...
TypeError: unsupported operand parent(s) for '+':
'Symbolic Ring' and 'Complex Field with 53 bits of precision'

This works with "usual" complex numbers:

sage: CC(1) + SR(i)
1.00000000000000 + 1.00000000000000*I

and with the "number-field" version of i
(now the default after #18036):

sage: MPC(1) + i
1.00000000000000 + 1.00000000000000*I

CC: @nexttime @slel

Component: coercion

Keywords: mpc complex numbers multiprecision.org

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

@jpflori jpflori added this to the sage-5.11 milestone Sep 16, 2011
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@jdemeyer jdemeyer modified the milestones: sage-6.4, sage-6.9 Sep 10, 2015
@slel
Copy link
Member

slel commented Apr 29, 2021

comment:7

Updating ticket description after #18036 was merged in 9.3.beta2.

This, which was failing in the original report, now works:

sage: MPC(1) + i
1.00000000000000 + 1.00000000000000*I

but this still fails:

sage: MPC(1) + SR(i)

@slel

This comment has been minimized.

@slel slel modified the milestones: sage-6.9, sage-9.4 Apr 29, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 22, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
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

5 participants