Ask Your Question
2

How to print tensor's name only as a string

asked 2 years ago

Liwei gravatar image

Hi, I have a tensor ct = M.tensor_field(1,1, name='c') And I want get the name of ct ('c') as a string. Is there a way to do this? Thanks

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 2 years ago

tmonteil gravatar image

There might be a more official way, but you can use its _name attribute:

sage: ct._name
'c'
Preview: (hide)
link

Comments

Gotcha. Thanks

Liwei gravatar imageLiwei ( 2 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2 years ago

Seen: 163 times

Last updated: May 04 '22