K. notation in Python 2












4















In one example of Sage math (search for octahedral) there is this line:



K.<v> = sage.groups.matrix_gps.finitely_generated.CyclotomicField(10)


What does this .<v> do?










share|improve this question




















  • 4





    Can you link to the example? That doesn't look like anything Python I'm familiar with.

    – Mad Physicist
    Jan 2 at 18:07






  • 2





    I'm fairly certain that would be a SyntaxError in any version Python.

    – juanpa.arrivillaga
    Jan 2 at 18:09






  • 4





    "SageMath is a free open-source mathematics software system [...]. Access their combined power through a common, Python-based language" - i.e. not bare Python directly.

    – melpomene
    Jan 2 at 18:10






  • 2





    I have never even heard of this However 2 mins of reading the documentation describes this as We can specify a different generator name as follows. so v would be the generator name returned by k.gen(). I would suggest to read the documentation.

    – Chris Doyle
    Jan 2 at 18:14








  • 2





    doc.sagemath.org/html/en/reference/repl/sage/repl/… looks relevant.

    – melpomene
    Jan 2 at 18:18
















4















In one example of Sage math (search for octahedral) there is this line:



K.<v> = sage.groups.matrix_gps.finitely_generated.CyclotomicField(10)


What does this .<v> do?










share|improve this question




















  • 4





    Can you link to the example? That doesn't look like anything Python I'm familiar with.

    – Mad Physicist
    Jan 2 at 18:07






  • 2





    I'm fairly certain that would be a SyntaxError in any version Python.

    – juanpa.arrivillaga
    Jan 2 at 18:09






  • 4





    "SageMath is a free open-source mathematics software system [...]. Access their combined power through a common, Python-based language" - i.e. not bare Python directly.

    – melpomene
    Jan 2 at 18:10






  • 2





    I have never even heard of this However 2 mins of reading the documentation describes this as We can specify a different generator name as follows. so v would be the generator name returned by k.gen(). I would suggest to read the documentation.

    – Chris Doyle
    Jan 2 at 18:14








  • 2





    doc.sagemath.org/html/en/reference/repl/sage/repl/… looks relevant.

    – melpomene
    Jan 2 at 18:18














4












4








4








In one example of Sage math (search for octahedral) there is this line:



K.<v> = sage.groups.matrix_gps.finitely_generated.CyclotomicField(10)


What does this .<v> do?










share|improve this question
















In one example of Sage math (search for octahedral) there is this line:



K.<v> = sage.groups.matrix_gps.finitely_generated.CyclotomicField(10)


What does this .<v> do?







python python-2.7 sage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 18:19







Martin Ueding

















asked Jan 2 at 18:05









Martin UedingMartin Ueding

3,72133155




3,72133155








  • 4





    Can you link to the example? That doesn't look like anything Python I'm familiar with.

    – Mad Physicist
    Jan 2 at 18:07






  • 2





    I'm fairly certain that would be a SyntaxError in any version Python.

    – juanpa.arrivillaga
    Jan 2 at 18:09






  • 4





    "SageMath is a free open-source mathematics software system [...]. Access their combined power through a common, Python-based language" - i.e. not bare Python directly.

    – melpomene
    Jan 2 at 18:10






  • 2





    I have never even heard of this However 2 mins of reading the documentation describes this as We can specify a different generator name as follows. so v would be the generator name returned by k.gen(). I would suggest to read the documentation.

    – Chris Doyle
    Jan 2 at 18:14








  • 2





    doc.sagemath.org/html/en/reference/repl/sage/repl/… looks relevant.

    – melpomene
    Jan 2 at 18:18














  • 4





    Can you link to the example? That doesn't look like anything Python I'm familiar with.

    – Mad Physicist
    Jan 2 at 18:07






  • 2





    I'm fairly certain that would be a SyntaxError in any version Python.

    – juanpa.arrivillaga
    Jan 2 at 18:09






  • 4





    "SageMath is a free open-source mathematics software system [...]. Access their combined power through a common, Python-based language" - i.e. not bare Python directly.

    – melpomene
    Jan 2 at 18:10






  • 2





    I have never even heard of this However 2 mins of reading the documentation describes this as We can specify a different generator name as follows. so v would be the generator name returned by k.gen(). I would suggest to read the documentation.

    – Chris Doyle
    Jan 2 at 18:14








  • 2





    doc.sagemath.org/html/en/reference/repl/sage/repl/… looks relevant.

    – melpomene
    Jan 2 at 18:18








4




4





Can you link to the example? That doesn't look like anything Python I'm familiar with.

– Mad Physicist
Jan 2 at 18:07





Can you link to the example? That doesn't look like anything Python I'm familiar with.

– Mad Physicist
Jan 2 at 18:07




2




2





I'm fairly certain that would be a SyntaxError in any version Python.

– juanpa.arrivillaga
Jan 2 at 18:09





I'm fairly certain that would be a SyntaxError in any version Python.

– juanpa.arrivillaga
Jan 2 at 18:09




4




4





"SageMath is a free open-source mathematics software system [...]. Access their combined power through a common, Python-based language" - i.e. not bare Python directly.

– melpomene
Jan 2 at 18:10





"SageMath is a free open-source mathematics software system [...]. Access their combined power through a common, Python-based language" - i.e. not bare Python directly.

– melpomene
Jan 2 at 18:10




2




2





I have never even heard of this However 2 mins of reading the documentation describes this as We can specify a different generator name as follows. so v would be the generator name returned by k.gen(). I would suggest to read the documentation.

– Chris Doyle
Jan 2 at 18:14







I have never even heard of this However 2 mins of reading the documentation describes this as We can specify a different generator name as follows. so v would be the generator name returned by k.gen(). I would suggest to read the documentation.

– Chris Doyle
Jan 2 at 18:14






2




2





doc.sagemath.org/html/en/reference/repl/sage/repl/… looks relevant.

– melpomene
Jan 2 at 18:18





doc.sagemath.org/html/en/reference/repl/sage/repl/… looks relevant.

– melpomene
Jan 2 at 18:18












1 Answer
1






active

oldest

votes


















5














SageMath code is not Python, albeit very similar. The syntax



A.<b> = C(d, e, f)


in SageMath is roughly equivalent to the following Python code



A = C(d, e, f, names=('b',))
b = A.gen()


I.e., first the parent ring A is created, with generator named 'b', then a variable b is initialized to the generator of A.



You can see what any SageMath statement is translated to using the function preparse():



sage: preparse('A.<b> = C(d, e, f)')
"A = C(d, e, f, names=('b',)); (b,) = A._first_ngens(1)"





share|improve this answer



















  • 1





    The author of this grammar (I don't mean the author of this answer) needs exorcism.

    – ElmoVanKielmo
    Jan 3 at 7:18






  • 1





    This grammar was inspired by the Magma user language. The preparser hack is nasty, but I don't see what's bad in the grammar per se.

    – Luca De Feo
    Jan 4 at 11:16






  • 2





    This - the preparser hack is nasty.

    – ElmoVanKielmo
    Jan 7 at 4:43











  • Well, depends on what you mean by nasty. In this case, the desire to have something users would instantly be familiar with overrode nasty.

    – kcrisman
    Feb 1 at 2:46











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54011089%2fk-v-notation-in-python-2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














SageMath code is not Python, albeit very similar. The syntax



A.<b> = C(d, e, f)


in SageMath is roughly equivalent to the following Python code



A = C(d, e, f, names=('b',))
b = A.gen()


I.e., first the parent ring A is created, with generator named 'b', then a variable b is initialized to the generator of A.



You can see what any SageMath statement is translated to using the function preparse():



sage: preparse('A.<b> = C(d, e, f)')
"A = C(d, e, f, names=('b',)); (b,) = A._first_ngens(1)"





share|improve this answer



















  • 1





    The author of this grammar (I don't mean the author of this answer) needs exorcism.

    – ElmoVanKielmo
    Jan 3 at 7:18






  • 1





    This grammar was inspired by the Magma user language. The preparser hack is nasty, but I don't see what's bad in the grammar per se.

    – Luca De Feo
    Jan 4 at 11:16






  • 2





    This - the preparser hack is nasty.

    – ElmoVanKielmo
    Jan 7 at 4:43











  • Well, depends on what you mean by nasty. In this case, the desire to have something users would instantly be familiar with overrode nasty.

    – kcrisman
    Feb 1 at 2:46
















5














SageMath code is not Python, albeit very similar. The syntax



A.<b> = C(d, e, f)


in SageMath is roughly equivalent to the following Python code



A = C(d, e, f, names=('b',))
b = A.gen()


I.e., first the parent ring A is created, with generator named 'b', then a variable b is initialized to the generator of A.



You can see what any SageMath statement is translated to using the function preparse():



sage: preparse('A.<b> = C(d, e, f)')
"A = C(d, e, f, names=('b',)); (b,) = A._first_ngens(1)"





share|improve this answer



















  • 1





    The author of this grammar (I don't mean the author of this answer) needs exorcism.

    – ElmoVanKielmo
    Jan 3 at 7:18






  • 1





    This grammar was inspired by the Magma user language. The preparser hack is nasty, but I don't see what's bad in the grammar per se.

    – Luca De Feo
    Jan 4 at 11:16






  • 2





    This - the preparser hack is nasty.

    – ElmoVanKielmo
    Jan 7 at 4:43











  • Well, depends on what you mean by nasty. In this case, the desire to have something users would instantly be familiar with overrode nasty.

    – kcrisman
    Feb 1 at 2:46














5












5








5







SageMath code is not Python, albeit very similar. The syntax



A.<b> = C(d, e, f)


in SageMath is roughly equivalent to the following Python code



A = C(d, e, f, names=('b',))
b = A.gen()


I.e., first the parent ring A is created, with generator named 'b', then a variable b is initialized to the generator of A.



You can see what any SageMath statement is translated to using the function preparse():



sage: preparse('A.<b> = C(d, e, f)')
"A = C(d, e, f, names=('b',)); (b,) = A._first_ngens(1)"





share|improve this answer













SageMath code is not Python, albeit very similar. The syntax



A.<b> = C(d, e, f)


in SageMath is roughly equivalent to the following Python code



A = C(d, e, f, names=('b',))
b = A.gen()


I.e., first the parent ring A is created, with generator named 'b', then a variable b is initialized to the generator of A.



You can see what any SageMath statement is translated to using the function preparse():



sage: preparse('A.<b> = C(d, e, f)')
"A = C(d, e, f, names=('b',)); (b,) = A._first_ngens(1)"






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 2 at 22:35









Luca De FeoLuca De Feo

506311




506311








  • 1





    The author of this grammar (I don't mean the author of this answer) needs exorcism.

    – ElmoVanKielmo
    Jan 3 at 7:18






  • 1





    This grammar was inspired by the Magma user language. The preparser hack is nasty, but I don't see what's bad in the grammar per se.

    – Luca De Feo
    Jan 4 at 11:16






  • 2





    This - the preparser hack is nasty.

    – ElmoVanKielmo
    Jan 7 at 4:43











  • Well, depends on what you mean by nasty. In this case, the desire to have something users would instantly be familiar with overrode nasty.

    – kcrisman
    Feb 1 at 2:46














  • 1





    The author of this grammar (I don't mean the author of this answer) needs exorcism.

    – ElmoVanKielmo
    Jan 3 at 7:18






  • 1





    This grammar was inspired by the Magma user language. The preparser hack is nasty, but I don't see what's bad in the grammar per se.

    – Luca De Feo
    Jan 4 at 11:16






  • 2





    This - the preparser hack is nasty.

    – ElmoVanKielmo
    Jan 7 at 4:43











  • Well, depends on what you mean by nasty. In this case, the desire to have something users would instantly be familiar with overrode nasty.

    – kcrisman
    Feb 1 at 2:46








1




1





The author of this grammar (I don't mean the author of this answer) needs exorcism.

– ElmoVanKielmo
Jan 3 at 7:18





The author of this grammar (I don't mean the author of this answer) needs exorcism.

– ElmoVanKielmo
Jan 3 at 7:18




1




1





This grammar was inspired by the Magma user language. The preparser hack is nasty, but I don't see what's bad in the grammar per se.

– Luca De Feo
Jan 4 at 11:16





This grammar was inspired by the Magma user language. The preparser hack is nasty, but I don't see what's bad in the grammar per se.

– Luca De Feo
Jan 4 at 11:16




2




2





This - the preparser hack is nasty.

– ElmoVanKielmo
Jan 7 at 4:43





This - the preparser hack is nasty.

– ElmoVanKielmo
Jan 7 at 4:43













Well, depends on what you mean by nasty. In this case, the desire to have something users would instantly be familiar with overrode nasty.

– kcrisman
Feb 1 at 2:46





Well, depends on what you mean by nasty. In this case, the desire to have something users would instantly be familiar with overrode nasty.

– kcrisman
Feb 1 at 2:46




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54011089%2fk-v-notation-in-python-2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'