body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
fdbfed3a2ac301ab22c709fbc63a5123ae3d14369e6fd7cb1018e881acbec562
def make_assembly_taxonomy_chart(tax_profile, genes, function_list, outfile, krona_path, metric='efpkg'): "Writes XML file for taxonomy chart of assembly, one chart for all reads and separate charts\n for each function and generates Krona plot from it\n\n Args:\n tax_profile (:obj:TaxonomyProfile): taxonomy profile object\n genes (defaultdict[str,defaultdict[str,dict[str,float]]]): outer key is\n gene identifier, middle key is function identifier, inner key is in\n [metric, 'count', 'identity', 'coverage', 'Length', 'Completeness'],\n value is float (genes[gene_id][function_id][parameter_name] = parameter_value).\n function_list (list of str): function identifiers\n outfile (str): path for XML output\n krona_path (str): Krona Tools command\n metric (str): scoring metric (efpkg by default)\n " with open(outfile, 'w') as out: out.write('<krona key="false">\n') out.write((('\t<attributes magnitude="' + metric) + '">\n')) if (metric != 'readcount'): out.write('\t\t<attribute display="Read count">readcount</attribute>\n') out.write((((('\t\t<attribute display="Score:' + metric) + '">') + metric) + '</attribute>\n')) out.write('\t\t<attribute display="Coverage" mono="true">coverage</attribute>\n') out.write('\t\t<attribute display="Length" mono="true">Length</attribute>\n') out.write(('\t\t<attribute display="CDS completeness %" mono="true">Completeness' + '</attribute>\n')) out.write('\t\t<attribute display="Best hit identity %" mono="true">identity</attribute>\n') out.write(('\t\t<attribute display="UniRef hit" hrefbase="https://www.uniprot.org/uniref/" ' + 'target="uniref" mono="true">best_hit</attribute>\n')) out.write('\t</attributes>\n') out.write(('\t<color attribute="identity" valueStart="50" valueEnd="100" hueStart="0" ' + 'hueEnd="240" default="true"></color>\n')) out.write('\t<datasets>\n') for function in function_list: out.write((('\t\t<dataset>' + function) + '</dataset>\n')) out.write('\t</datasets>\n') offset = 1 out.write(get_assembly_tax_xml(tax_profile, genes, function_list, ROOT_TAXONOMY_ID, offset, metric)) out.write('</krona>') html_file = (outfile + '.html') krona_cmd = [krona_path, '-o', html_file, outfile] run_external_program(krona_cmd)
Writes XML file for taxonomy chart of assembly, one chart for all reads and separate charts for each function and generates Krona plot from it Args: tax_profile (:obj:TaxonomyProfile): taxonomy profile object genes (defaultdict[str,defaultdict[str,dict[str,float]]]): outer key is gene identifier, middle key is function identifier, inner key is in [metric, 'count', 'identity', 'coverage', 'Length', 'Completeness'], value is float (genes[gene_id][function_id][parameter_name] = parameter_value). function_list (list of str): function identifiers outfile (str): path for XML output krona_path (str): Krona Tools command metric (str): scoring metric (efpkg by default)
lib/fama/output/krona_xml_writer.py
make_assembly_taxonomy_chart
aekazakov/FamaProfiling
0
python
def make_assembly_taxonomy_chart(tax_profile, genes, function_list, outfile, krona_path, metric='efpkg'): "Writes XML file for taxonomy chart of assembly, one chart for all reads and separate charts\n for each function and generates Krona plot from it\n\n Args:\n tax_profile (:obj:TaxonomyProfile): taxonomy profile object\n genes (defaultdict[str,defaultdict[str,dict[str,float]]]): outer key is\n gene identifier, middle key is function identifier, inner key is in\n [metric, 'count', 'identity', 'coverage', 'Length', 'Completeness'],\n value is float (genes[gene_id][function_id][parameter_name] = parameter_value).\n function_list (list of str): function identifiers\n outfile (str): path for XML output\n krona_path (str): Krona Tools command\n metric (str): scoring metric (efpkg by default)\n " with open(outfile, 'w') as out: out.write('<krona key="false">\n') out.write((('\t<attributes magnitude="' + metric) + '">\n')) if (metric != 'readcount'): out.write('\t\t<attribute display="Read count">readcount</attribute>\n') out.write((((('\t\t<attribute display="Score:' + metric) + '">') + metric) + '</attribute>\n')) out.write('\t\t<attribute display="Coverage" mono="true">coverage</attribute>\n') out.write('\t\t<attribute display="Length" mono="true">Length</attribute>\n') out.write(('\t\t<attribute display="CDS completeness %" mono="true">Completeness' + '</attribute>\n')) out.write('\t\t<attribute display="Best hit identity %" mono="true">identity</attribute>\n') out.write(('\t\t<attribute display="UniRef hit" hrefbase="https://www.uniprot.org/uniref/" ' + 'target="uniref" mono="true">best_hit</attribute>\n')) out.write('\t</attributes>\n') out.write(('\t<color attribute="identity" valueStart="50" valueEnd="100" hueStart="0" ' + 'hueEnd="240" default="true"></color>\n')) out.write('\t<datasets>\n') for function in function_list: out.write((('\t\t<dataset>' + function) + '</dataset>\n')) out.write('\t</datasets>\n') offset = 1 out.write(get_assembly_tax_xml(tax_profile, genes, function_list, ROOT_TAXONOMY_ID, offset, metric)) out.write('</krona>') html_file = (outfile + '.html') krona_cmd = [krona_path, '-o', html_file, outfile] run_external_program(krona_cmd)
def make_assembly_taxonomy_chart(tax_profile, genes, function_list, outfile, krona_path, metric='efpkg'): "Writes XML file for taxonomy chart of assembly, one chart for all reads and separate charts\n for each function and generates Krona plot from it\n\n Args:\n tax_profile (:obj:TaxonomyProfile): taxonomy profile object\n genes (defaultdict[str,defaultdict[str,dict[str,float]]]): outer key is\n gene identifier, middle key is function identifier, inner key is in\n [metric, 'count', 'identity', 'coverage', 'Length', 'Completeness'],\n value is float (genes[gene_id][function_id][parameter_name] = parameter_value).\n function_list (list of str): function identifiers\n outfile (str): path for XML output\n krona_path (str): Krona Tools command\n metric (str): scoring metric (efpkg by default)\n " with open(outfile, 'w') as out: out.write('<krona key="false">\n') out.write((('\t<attributes magnitude="' + metric) + '">\n')) if (metric != 'readcount'): out.write('\t\t<attribute display="Read count">readcount</attribute>\n') out.write((((('\t\t<attribute display="Score:' + metric) + '">') + metric) + '</attribute>\n')) out.write('\t\t<attribute display="Coverage" mono="true">coverage</attribute>\n') out.write('\t\t<attribute display="Length" mono="true">Length</attribute>\n') out.write(('\t\t<attribute display="CDS completeness %" mono="true">Completeness' + '</attribute>\n')) out.write('\t\t<attribute display="Best hit identity %" mono="true">identity</attribute>\n') out.write(('\t\t<attribute display="UniRef hit" hrefbase="https://www.uniprot.org/uniref/" ' + 'target="uniref" mono="true">best_hit</attribute>\n')) out.write('\t</attributes>\n') out.write(('\t<color attribute="identity" valueStart="50" valueEnd="100" hueStart="0" ' + 'hueEnd="240" default="true"></color>\n')) out.write('\t<datasets>\n') for function in function_list: out.write((('\t\t<dataset>' + function) + '</dataset>\n')) out.write('\t</datasets>\n') offset = 1 out.write(get_assembly_tax_xml(tax_profile, genes, function_list, ROOT_TAXONOMY_ID, offset, metric)) out.write('</krona>') html_file = (outfile + '.html') krona_cmd = [krona_path, '-o', html_file, outfile] run_external_program(krona_cmd)<|docstring|>Writes XML file for taxonomy chart of assembly, one chart for all reads and separate charts for each function and generates Krona plot from it Args: tax_profile (:obj:TaxonomyProfile): taxonomy profile object genes (defaultdict[str,defaultdict[str,dict[str,float]]]): outer key is gene identifier, middle key is function identifier, inner key is in [metric, 'count', 'identity', 'coverage', 'Length', 'Completeness'], value is float (genes[gene_id][function_id][parameter_name] = parameter_value). function_list (list of str): function identifiers outfile (str): path for XML output krona_path (str): Krona Tools command metric (str): scoring metric (efpkg by default)<|endoftext|>
78ae0002514fdcf8aa4278eb7c0838eed2f480eb180ccd38685493fb309627a7
def check_env_var(a_var, a_var_name): ' Check that an expected environment variable is actually present.\n\n :param a_var: Variable to be checked\n :param a_var_name: Name of environment variable that should be present\n :return: None; exit program if variable is not present\n ' if (a_var is None): print(f'Environment variable {a_var_name} is not present!') sys.exit(2)
Check that an expected environment variable is actually present. :param a_var: Variable to be checked :param a_var_name: Name of environment variable that should be present :return: None; exit program if variable is not present
coll/mc_sim_coll_blog.py
check_env_var
aws-samples/optimize-your-monte-carlo-simulations-using-aws-batch
1
python
def check_env_var(a_var, a_var_name): ' Check that an expected environment variable is actually present.\n\n :param a_var: Variable to be checked\n :param a_var_name: Name of environment variable that should be present\n :return: None; exit program if variable is not present\n ' if (a_var is None): print(f'Environment variable {a_var_name} is not present!') sys.exit(2)
def check_env_var(a_var, a_var_name): ' Check that an expected environment variable is actually present.\n\n :param a_var: Variable to be checked\n :param a_var_name: Name of environment variable that should be present\n :return: None; exit program if variable is not present\n ' if (a_var is None): print(f'Environment variable {a_var_name} is not present!') sys.exit(2)<|docstring|>Check that an expected environment variable is actually present. :param a_var: Variable to be checked :param a_var_name: Name of environment variable that should be present :return: None; exit program if variable is not present<|endoftext|>
71649988aaed8330217a9e22dcae38cc600746bcd002d117b5dc1d9f1bc5c272
def upload_file(file_name, bucket, object_name=None): 'Upload a file to an S3 bucket\n\n :param file_name: File to upload\n :param bucket: Bucket to upload to\n :param object_name: S3 object name. If not specified then file_name is used\n :return: True if file was uploaded, else False\n ' if (object_name is None): object_name = os.path.basename(file_name) s3_client = boto3.client('s3') try: response = s3_client.upload_file(file_name, bucket, object_name) except ClientError as e: logging.error(e) return False return True
Upload a file to an S3 bucket :param file_name: File to upload :param bucket: Bucket to upload to :param object_name: S3 object name. If not specified then file_name is used :return: True if file was uploaded, else False
coll/mc_sim_coll_blog.py
upload_file
aws-samples/optimize-your-monte-carlo-simulations-using-aws-batch
1
python
def upload_file(file_name, bucket, object_name=None): 'Upload a file to an S3 bucket\n\n :param file_name: File to upload\n :param bucket: Bucket to upload to\n :param object_name: S3 object name. If not specified then file_name is used\n :return: True if file was uploaded, else False\n ' if (object_name is None): object_name = os.path.basename(file_name) s3_client = boto3.client('s3') try: response = s3_client.upload_file(file_name, bucket, object_name) except ClientError as e: logging.error(e) return False return True
def upload_file(file_name, bucket, object_name=None): 'Upload a file to an S3 bucket\n\n :param file_name: File to upload\n :param bucket: Bucket to upload to\n :param object_name: S3 object name. If not specified then file_name is used\n :return: True if file was uploaded, else False\n ' if (object_name is None): object_name = os.path.basename(file_name) s3_client = boto3.client('s3') try: response = s3_client.upload_file(file_name, bucket, object_name) except ClientError as e: logging.error(e) return False return True<|docstring|>Upload a file to an S3 bucket :param file_name: File to upload :param bucket: Bucket to upload to :param object_name: S3 object name. If not specified then file_name is used :return: True if file was uploaded, else False<|endoftext|>
512a44fa9ddedd2e089856d28b04f208a3de525e2e1827c8dc9ce3976e737446
def get_input_csv(bucket_name, file_name): ' Download and read CSV file from an S3 bucket\n\n :param bucket_name: Bucket in which CSV file is located\n :param file_name: key name of the CSV file to read\n :return: DataFrame constructed from CSV file\n ' s3 = boto3.client('s3') response = s3.get_object(Bucket=bucket_name, Key=file_name) status = response.get('ResponseMetadata', {}).get('HTTPStatusCode') if (status == 200): print(f'Retrieved file {file_name} from bucket {bucket_name}') return pd.read_csv(response.get('Body'), index_col=0) else: print(f'Error in retrieving file {file_name} from bucket {bucket_name}; {status}') sys.exit(1)
Download and read CSV file from an S3 bucket :param bucket_name: Bucket in which CSV file is located :param file_name: key name of the CSV file to read :return: DataFrame constructed from CSV file
coll/mc_sim_coll_blog.py
get_input_csv
aws-samples/optimize-your-monte-carlo-simulations-using-aws-batch
1
python
def get_input_csv(bucket_name, file_name): ' Download and read CSV file from an S3 bucket\n\n :param bucket_name: Bucket in which CSV file is located\n :param file_name: key name of the CSV file to read\n :return: DataFrame constructed from CSV file\n ' s3 = boto3.client('s3') response = s3.get_object(Bucket=bucket_name, Key=file_name) status = response.get('ResponseMetadata', {}).get('HTTPStatusCode') if (status == 200): print(f'Retrieved file {file_name} from bucket {bucket_name}') return pd.read_csv(response.get('Body'), index_col=0) else: print(f'Error in retrieving file {file_name} from bucket {bucket_name}; {status}') sys.exit(1)
def get_input_csv(bucket_name, file_name): ' Download and read CSV file from an S3 bucket\n\n :param bucket_name: Bucket in which CSV file is located\n :param file_name: key name of the CSV file to read\n :return: DataFrame constructed from CSV file\n ' s3 = boto3.client('s3') response = s3.get_object(Bucket=bucket_name, Key=file_name) status = response.get('ResponseMetadata', {}).get('HTTPStatusCode') if (status == 200): print(f'Retrieved file {file_name} from bucket {bucket_name}') return pd.read_csv(response.get('Body'), index_col=0) else: print(f'Error in retrieving file {file_name} from bucket {bucket_name}; {status}') sys.exit(1)<|docstring|>Download and read CSV file from an S3 bucket :param bucket_name: Bucket in which CSV file is located :param file_name: key name of the CSV file to read :return: DataFrame constructed from CSV file<|endoftext|>
9696adca477e87492f3ccf9c29025870a80c2f39993f80332e2b622697c12bfe
def list_csv_files(bucket_name, folder_name=''): ' List all CSV files in a given folder in S3 bucket\n\n :param bucket_name: Bucket in which CSV files is located\n :param folder_name: Folder in bucket in which CSV files reside\n :return: List of names of CSV files in given bucket\n ' files = [] s3 = boto3.client('s3') for f in s3.list_objects_v2(Bucket=bucket_name, Prefix=folder_name)['Contents']: if (f['Key'].split('.')[(- 1)] == 'csv'): files.append(f['Key']) return files
List all CSV files in a given folder in S3 bucket :param bucket_name: Bucket in which CSV files is located :param folder_name: Folder in bucket in which CSV files reside :return: List of names of CSV files in given bucket
coll/mc_sim_coll_blog.py
list_csv_files
aws-samples/optimize-your-monte-carlo-simulations-using-aws-batch
1
python
def list_csv_files(bucket_name, folder_name=): ' List all CSV files in a given folder in S3 bucket\n\n :param bucket_name: Bucket in which CSV files is located\n :param folder_name: Folder in bucket in which CSV files reside\n :return: List of names of CSV files in given bucket\n ' files = [] s3 = boto3.client('s3') for f in s3.list_objects_v2(Bucket=bucket_name, Prefix=folder_name)['Contents']: if (f['Key'].split('.')[(- 1)] == 'csv'): files.append(f['Key']) return files
def list_csv_files(bucket_name, folder_name=): ' List all CSV files in a given folder in S3 bucket\n\n :param bucket_name: Bucket in which CSV files is located\n :param folder_name: Folder in bucket in which CSV files reside\n :return: List of names of CSV files in given bucket\n ' files = [] s3 = boto3.client('s3') for f in s3.list_objects_v2(Bucket=bucket_name, Prefix=folder_name)['Contents']: if (f['Key'].split('.')[(- 1)] == 'csv'): files.append(f['Key']) return files<|docstring|>List all CSV files in a given folder in S3 bucket :param bucket_name: Bucket in which CSV files is located :param folder_name: Folder in bucket in which CSV files reside :return: List of names of CSV files in given bucket<|endoftext|>
f09c5a4a22c789a381588bd91f766a639a56d0b23721d632a826c7429e98cb0e
def test_ir2fr(): '\n Test whether the frequency vector is correct.\n ' t = 1.0 fs = 100.0 f = 20.0 ts = np.arange(0, t, (1.0 / fs)) A = 5.0 x = (A * np.sin((((2.0 * np.pi) * f) * ts))) (fv, fr) = ir2fr(x, fs) assert_array_almost_equal(fv[np.abs(fr).argmax()], f) assert_array_almost_equal(np.abs(fr).max(), A)
Test whether the frequency vector is correct.
tests/test_signal.py
test_ir2fr
andimarafioti/python-acoustics
1
python
def test_ir2fr(): '\n \n ' t = 1.0 fs = 100.0 f = 20.0 ts = np.arange(0, t, (1.0 / fs)) A = 5.0 x = (A * np.sin((((2.0 * np.pi) * f) * ts))) (fv, fr) = ir2fr(x, fs) assert_array_almost_equal(fv[np.abs(fr).argmax()], f) assert_array_almost_equal(np.abs(fr).max(), A)
def test_ir2fr(): '\n \n ' t = 1.0 fs = 100.0 f = 20.0 ts = np.arange(0, t, (1.0 / fs)) A = 5.0 x = (A * np.sin((((2.0 * np.pi) * f) * ts))) (fv, fr) = ir2fr(x, fs) assert_array_almost_equal(fv[np.abs(fr).argmax()], f) assert_array_almost_equal(np.abs(fr).max(), A)<|docstring|>Test whether the frequency vector is correct.<|endoftext|>
0429c965fd91e2a54d0f8bf9f53005518b3180a8aa7dcf861d44d16f61c4c36a
def test_LTI(self): '\n Test whether it gives correct results for the LTI case.\n ' 'Input signals.' signals = [np.array([1, 2, 3, 4, 3, 2, 1], dtype='float'), np.array([1, 2, 3, 4, 3, 2, 1, 1], dtype='float')] 'Filters' filters = [np.array([1, 2, 3, 4], dtype='float'), np.array([1, 2, 3, 4, 5], dtype='float')] 'Test for every combination of input signal and filter.' for (u, h) in itertools.product(signals, filters): H = np.tile(h, (len(u), 1)).T np.testing.assert_array_almost_equal(convolveLTV(u, H), convolveLTI(u, h)) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='full'), convolveLTI(u, h, mode='full')) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='valid'), convolveLTI(u, h, mode='valid')) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='same'), convolveLTI(u, h, mode='same'))
Test whether it gives correct results for the LTI case.
tests/test_signal.py
test_LTI
andimarafioti/python-acoustics
1
python
def test_LTI(self): '\n \n ' 'Input signals.' signals = [np.array([1, 2, 3, 4, 3, 2, 1], dtype='float'), np.array([1, 2, 3, 4, 3, 2, 1, 1], dtype='float')] 'Filters' filters = [np.array([1, 2, 3, 4], dtype='float'), np.array([1, 2, 3, 4, 5], dtype='float')] 'Test for every combination of input signal and filter.' for (u, h) in itertools.product(signals, filters): H = np.tile(h, (len(u), 1)).T np.testing.assert_array_almost_equal(convolveLTV(u, H), convolveLTI(u, h)) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='full'), convolveLTI(u, h, mode='full')) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='valid'), convolveLTI(u, h, mode='valid')) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='same'), convolveLTI(u, h, mode='same'))
def test_LTI(self): '\n \n ' 'Input signals.' signals = [np.array([1, 2, 3, 4, 3, 2, 1], dtype='float'), np.array([1, 2, 3, 4, 3, 2, 1, 1], dtype='float')] 'Filters' filters = [np.array([1, 2, 3, 4], dtype='float'), np.array([1, 2, 3, 4, 5], dtype='float')] 'Test for every combination of input signal and filter.' for (u, h) in itertools.product(signals, filters): H = np.tile(h, (len(u), 1)).T np.testing.assert_array_almost_equal(convolveLTV(u, H), convolveLTI(u, h)) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='full'), convolveLTI(u, h, mode='full')) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='valid'), convolveLTI(u, h, mode='valid')) np.testing.assert_array_almost_equal(convolveLTV(u, H, mode='same'), convolveLTI(u, h, mode='same'))<|docstring|>Test whether it gives correct results for the LTI case.<|endoftext|>
b352d6cc6626731edff86dfe3803eff6cc38e687c8bbe040de46c3c781a8d6fe
def test_LTV(self): '\n Test whether it gives correct results for the LTV case.\n ' 'Input signal' u = np.array([1, 1, 1]) 'Impulse responses where each column represents an impulse response.' C = np.array([[1, 0, 0], [2, 1, 1]]) 'The result calculated manually.' y_manual = np.array([1, 2, 1, 1]) y_ltv = convolveLTV(u, C) np.testing.assert_array_equal(y_ltv, y_manual)
Test whether it gives correct results for the LTV case.
tests/test_signal.py
test_LTV
andimarafioti/python-acoustics
1
python
def test_LTV(self): '\n \n ' 'Input signal' u = np.array([1, 1, 1]) 'Impulse responses where each column represents an impulse response.' C = np.array([[1, 0, 0], [2, 1, 1]]) 'The result calculated manually.' y_manual = np.array([1, 2, 1, 1]) y_ltv = convolveLTV(u, C) np.testing.assert_array_equal(y_ltv, y_manual)
def test_LTV(self): '\n \n ' 'Input signal' u = np.array([1, 1, 1]) 'Impulse responses where each column represents an impulse response.' C = np.array([[1, 0, 0], [2, 1, 1]]) 'The result calculated manually.' y_manual = np.array([1, 2, 1, 1]) y_ltv = convolveLTV(u, C) np.testing.assert_array_equal(y_ltv, y_manual)<|docstring|>Test whether it gives correct results for the LTV case.<|endoftext|>
9aadc79c140f1c2de15ef59ad2763534764cbf09e8d50c1361a53dfd626e230a
def test_construction_1(self): 'Using center.' x = np.arange(10.0, 20.0, 2.0) b = EqualBand(x) assert_array_equal(b.center, x)
Using center.
tests/test_signal.py
test_construction_1
andimarafioti/python-acoustics
1
python
def test_construction_1(self): x = np.arange(10.0, 20.0, 2.0) b = EqualBand(x) assert_array_equal(b.center, x)
def test_construction_1(self): x = np.arange(10.0, 20.0, 2.0) b = EqualBand(x) assert_array_equal(b.center, x)<|docstring|>Using center.<|endoftext|>
7cda07980a9931641085e642cd27d93af04c9fe95de794e689b02b4d4e756cd8
def test_construction_2(self): 'Using fstart, fstop and fbands' x = np.arange(10.0, 20.0, 2.0) fstart = x[0] fstop = x[(- 1)] nbands = len(x) b = EqualBand(fstart=fstart, fstop=fstop, nbands=nbands) assert_array_equal(b.center, x)
Using fstart, fstop and fbands
tests/test_signal.py
test_construction_2
andimarafioti/python-acoustics
1
python
def test_construction_2(self): x = np.arange(10.0, 20.0, 2.0) fstart = x[0] fstop = x[(- 1)] nbands = len(x) b = EqualBand(fstart=fstart, fstop=fstop, nbands=nbands) assert_array_equal(b.center, x)
def test_construction_2(self): x = np.arange(10.0, 20.0, 2.0) fstart = x[0] fstop = x[(- 1)] nbands = len(x) b = EqualBand(fstart=fstart, fstop=fstop, nbands=nbands) assert_array_equal(b.center, x)<|docstring|>Using fstart, fstop and fbands<|endoftext|>
3ae18da460af76c7321897f8ce75ad282df0b036e28949857f0a7b87bb558fd0
def test_construction_3(self): 'Using fstart, fstop and bandwidth' x = np.arange(10.0, 20.0, 2.0) fstart = x[0] fstop = x[(- 1)] bandwidth = np.diff(x)[0] b = EqualBand(fstart=fstart, fstop=fstop, bandwidth=bandwidth) assert_array_equal(b.center, x)
Using fstart, fstop and bandwidth
tests/test_signal.py
test_construction_3
andimarafioti/python-acoustics
1
python
def test_construction_3(self): x = np.arange(10.0, 20.0, 2.0) fstart = x[0] fstop = x[(- 1)] bandwidth = np.diff(x)[0] b = EqualBand(fstart=fstart, fstop=fstop, bandwidth=bandwidth) assert_array_equal(b.center, x)
def test_construction_3(self): x = np.arange(10.0, 20.0, 2.0) fstart = x[0] fstop = x[(- 1)] bandwidth = np.diff(x)[0] b = EqualBand(fstart=fstart, fstop=fstop, bandwidth=bandwidth) assert_array_equal(b.center, x)<|docstring|>Using fstart, fstop and bandwidth<|endoftext|>
e9e42bbf6125a0c027a9484245fd7e0873ac54d47a45da5447deb70a0a56f8cb
def write_history(line): 'ζŠŠζœ€ζ–°ηš„εŽ†ε²ε†™εœ¨ζœ€ε‰ζ–Ή' line = line.strip() if (line == ''): return with open(history_path, 'r+', encoding='utf8') as w: content = w.read() w.seek(0, 0) w.write(((line + '\n') + content))
ζŠŠζœ€ζ–°ηš„εŽ†ε²ε†™εœ¨ζœ€ε‰ζ–Ή
main.py
write_history
Taokyla/MikanToAria2
5
python
def write_history(line): line = line.strip() if (line == ): return with open(history_path, 'r+', encoding='utf8') as w: content = w.read() w.seek(0, 0) w.write(((line + '\n') + content))
def write_history(line): line = line.strip() if (line == ): return with open(history_path, 'r+', encoding='utf8') as w: content = w.read() w.seek(0, 0) w.write(((line + '\n') + content))<|docstring|>ζŠŠζœ€ζ–°ηš„εŽ†ε²ε†™εœ¨ζœ€ε‰ζ–Ή<|endoftext|>
54fa0cec1c7b3cf3c90d11bdbda9cc7e34129bf638ad2e94c63f48943d02dec9
def apply_transforms(fixed, moving, transformlist, interpolator='linear', imagetype=0, whichtoinvert=None, compose=None, verbose=False, **kwargs): "\n Apply a transform list to map an image from one domain to another. \n In image registration, one computes mappings between (usually) pairs \n of images. These transforms are often a sequence of increasingly \n complex maps, e.g. from translation, to rigid, to affine to deformation. \n The list of such transforms is passed to this function to interpolate one \n image domain into the next image domain, as below. The order matters \n strongly and the user is advised to familiarize with the standards \n established in examples.\n\n ANTsR function: `antsApplyTransforms`\n\n Arguments\n ---------\n fixed : ANTsImage\n fixed image defining domain into which the moving image is transformed.\n \n moving : AntsImage\n moving image to be mapped to fixed space.\n \n transformlist : list of strings \n list of transforms generated by ants.registration where each transform is a filename.\n \n interpolator : string \n Choice of interpolator. Supports partial matching.\n linear\n nearestNeighbor\n multiLabel for label images but genericlabel is preferred\n gaussian\n bSpline\n cosineWindowedSinc\n welchWindowedSinc\n hammingWindowedSinc\n lanczosWindowedSinc\n genericLabel use this for label images\n \n imagetype : integer \n choose 0/1/2/3 mapping to scalar/vector/tensor/time-series\n \n whichtoinvert : list of booleans (optional) \n Must be same length as transformlist.\n whichtoinvert[i] is True if transformlist[i] is a matrix, \n and the matrix should be inverted. If transformlist[i] is a \n warp field, whichtoinvert[i] must be False.\n If the transform list is a matrix followed by a warp field, \n whichtoinvert defaults to (True,False). Otherwise it defaults \n to [False]*len(transformlist)).\n \n compose : string (optional)\n if it is a string pointing to a valid file location, \n this will force the function to return a composite transformation filename.\n \n verbose : boolean\n print command and run verbose application of transform.\n \n kwargs : keyword arguments \n extra parameters\n \n Returns\n -------\n ANTsImage or string (transformation filename)\n\n Example\n -------\n >>> import ants\n >>> fixed = ants.image_read( ants.get_ants_data('r16') )\n >>> moving = ants.image_read( ants.get_ants_data('r64') )\n >>> fixed = ants.resample_image(fixed, (64,64), 1, 0)\n >>> moving = ants.resample_image(moving, (64,64), 1, 0)\n >>> mytx = ants.registration(fixed=fixed , moving=moving ,\n type_of_transform = 'SyN' )\n >>> mywarpedimage = ants.apply_transforms( fixed=fixed, moving=moving,\n transformlist=mytx['fwdtransforms'] )\n " if ((not isinstance(transformlist, (tuple, list))) and (transformlist is not None)): transformlist = [transformlist] accepted_interpolators = {'linear', 'nearestNeighbor', 'multiLabel', 'gaussian', 'bSpline', 'cosineWindowedSinc', 'welchWindowedSinc', 'hammingWindowedSinc', 'lanczosWindowedSinc', 'genericLabel'} if (interpolator not in accepted_interpolators): raise ValueError(('interpolator not supported - see %s' % accepted_interpolators)) args = [fixed, moving, transformlist, interpolator] if (not isinstance(fixed, str)): if (isinstance(fixed, iio.ANTsImage) and isinstance(moving, iio.ANTsImage)): for tl_path in transformlist: if (not os.path.exists(tl_path)): raise Exception(('Transform %s does not exist' % tl_path)) inpixeltype = fixed.pixeltype fixed = fixed.clone('float') moving = moving.clone('float') warpedmovout = moving.clone() f = fixed m = moving if ((moving.dimension == 4) and (fixed.dimension == 3) and (imagetype == 0)): raise Exception('Set imagetype 3 to transform time series images.') wmo = warpedmovout mytx = [] if ((whichtoinvert is None) or (isinstance(whichtoinvert, (tuple, list)) and (sum([(w is not None) for w in whichtoinvert]) == 0))): if ((len(transformlist) == 2) and ('.mat' in transformlist[0]) and ('.mat' not in transformlist[1])): whichtoinvert = (True, False) else: whichtoinvert = tuple(([False] * len(transformlist))) if (len(whichtoinvert) != len(transformlist)): raise ValueError('Transform list and inversion list must be the same length') for i in range(len(transformlist)): ismat = False if ('.mat' in transformlist[0]): ismat = True if (whichtoinvert[i] and (not ismat)): raise ValueError(('Cannot invert transform %i (%s) because it is not a matrix' % (i, transformlist[i]))) if whichtoinvert[i]: mytx = (mytx + ['-t', ('[%s,1]' % transformlist[i])]) else: mytx = (mytx + ['-t', transformlist[i]]) if (compose is None): args = ['-d', fixed.dimension, '-i', m, '-o', wmo, '-r', f, '-n', interpolator] args = (args + mytx) tfn = (('%scomptx.nii.gz' % compose) if (compose is not None) else 'NA') if (compose is not None): mycompo = ('[%s,1]' % tfn) args = ['-d', fixed.dimension, '-i', m, '-o', mycompo, '-r', f, '-n', interpolator] args = (args + mytx) myargs = utils._int_antsProcessArguments(args) for jj in range(len(myargs)): if (myargs[jj] is not None): if (myargs[jj] == '-'): myargs2 = ([None] * (len(myargs) - 1)) myargs2[:(jj - 1)] = myargs[:(jj - 1)] myargs2[jj:(len(myargs) - 1)] = myargs[(jj + 1):len(myargs)] myargs = myargs2 myverb = int(verbose) if verbose: print(myargs) processed_args = (myargs + ['-z', str(1), '-v', str(myverb), '--float', str(1), '-e', str(imagetype)]) libfn = utils.get_lib_fn('antsApplyTransforms') libfn(processed_args) if (compose is None): return warpedmovout.clone(inpixeltype) elif os.path.exists(tfn): return tfn else: return None else: return 1 else: args = (args + ['-z', 1, '--float', 1, '-e', imagetype]) processed_args = utils._int_antsProcessArguments(args) libfn = utils.get_lib_fn('antsApplyTransforms') libfn(processed_args)
Apply a transform list to map an image from one domain to another. In image registration, one computes mappings between (usually) pairs of images. These transforms are often a sequence of increasingly complex maps, e.g. from translation, to rigid, to affine to deformation. The list of such transforms is passed to this function to interpolate one image domain into the next image domain, as below. The order matters strongly and the user is advised to familiarize with the standards established in examples. ANTsR function: `antsApplyTransforms` Arguments --------- fixed : ANTsImage fixed image defining domain into which the moving image is transformed. moving : AntsImage moving image to be mapped to fixed space. transformlist : list of strings list of transforms generated by ants.registration where each transform is a filename. interpolator : string Choice of interpolator. Supports partial matching. linear nearestNeighbor multiLabel for label images but genericlabel is preferred gaussian bSpline cosineWindowedSinc welchWindowedSinc hammingWindowedSinc lanczosWindowedSinc genericLabel use this for label images imagetype : integer choose 0/1/2/3 mapping to scalar/vector/tensor/time-series whichtoinvert : list of booleans (optional) Must be same length as transformlist. whichtoinvert[i] is True if transformlist[i] is a matrix, and the matrix should be inverted. If transformlist[i] is a warp field, whichtoinvert[i] must be False. If the transform list is a matrix followed by a warp field, whichtoinvert defaults to (True,False). Otherwise it defaults to [False]*len(transformlist)). compose : string (optional) if it is a string pointing to a valid file location, this will force the function to return a composite transformation filename. verbose : boolean print command and run verbose application of transform. kwargs : keyword arguments extra parameters Returns ------- ANTsImage or string (transformation filename) Example ------- >>> import ants >>> fixed = ants.image_read( ants.get_ants_data('r16') ) >>> moving = ants.image_read( ants.get_ants_data('r64') ) >>> fixed = ants.resample_image(fixed, (64,64), 1, 0) >>> moving = ants.resample_image(moving, (64,64), 1, 0) >>> mytx = ants.registration(fixed=fixed , moving=moving , type_of_transform = 'SyN' ) >>> mywarpedimage = ants.apply_transforms( fixed=fixed, moving=moving, transformlist=mytx['fwdtransforms'] )
ants/registration/apply_transforms.py
apply_transforms
vascosa/ANTsPy
0
python
def apply_transforms(fixed, moving, transformlist, interpolator='linear', imagetype=0, whichtoinvert=None, compose=None, verbose=False, **kwargs): "\n Apply a transform list to map an image from one domain to another. \n In image registration, one computes mappings between (usually) pairs \n of images. These transforms are often a sequence of increasingly \n complex maps, e.g. from translation, to rigid, to affine to deformation. \n The list of such transforms is passed to this function to interpolate one \n image domain into the next image domain, as below. The order matters \n strongly and the user is advised to familiarize with the standards \n established in examples.\n\n ANTsR function: `antsApplyTransforms`\n\n Arguments\n ---------\n fixed : ANTsImage\n fixed image defining domain into which the moving image is transformed.\n \n moving : AntsImage\n moving image to be mapped to fixed space.\n \n transformlist : list of strings \n list of transforms generated by ants.registration where each transform is a filename.\n \n interpolator : string \n Choice of interpolator. Supports partial matching.\n linear\n nearestNeighbor\n multiLabel for label images but genericlabel is preferred\n gaussian\n bSpline\n cosineWindowedSinc\n welchWindowedSinc\n hammingWindowedSinc\n lanczosWindowedSinc\n genericLabel use this for label images\n \n imagetype : integer \n choose 0/1/2/3 mapping to scalar/vector/tensor/time-series\n \n whichtoinvert : list of booleans (optional) \n Must be same length as transformlist.\n whichtoinvert[i] is True if transformlist[i] is a matrix, \n and the matrix should be inverted. If transformlist[i] is a \n warp field, whichtoinvert[i] must be False.\n If the transform list is a matrix followed by a warp field, \n whichtoinvert defaults to (True,False). Otherwise it defaults \n to [False]*len(transformlist)).\n \n compose : string (optional)\n if it is a string pointing to a valid file location, \n this will force the function to return a composite transformation filename.\n \n verbose : boolean\n print command and run verbose application of transform.\n \n kwargs : keyword arguments \n extra parameters\n \n Returns\n -------\n ANTsImage or string (transformation filename)\n\n Example\n -------\n >>> import ants\n >>> fixed = ants.image_read( ants.get_ants_data('r16') )\n >>> moving = ants.image_read( ants.get_ants_data('r64') )\n >>> fixed = ants.resample_image(fixed, (64,64), 1, 0)\n >>> moving = ants.resample_image(moving, (64,64), 1, 0)\n >>> mytx = ants.registration(fixed=fixed , moving=moving ,\n type_of_transform = 'SyN' )\n >>> mywarpedimage = ants.apply_transforms( fixed=fixed, moving=moving,\n transformlist=mytx['fwdtransforms'] )\n " if ((not isinstance(transformlist, (tuple, list))) and (transformlist is not None)): transformlist = [transformlist] accepted_interpolators = {'linear', 'nearestNeighbor', 'multiLabel', 'gaussian', 'bSpline', 'cosineWindowedSinc', 'welchWindowedSinc', 'hammingWindowedSinc', 'lanczosWindowedSinc', 'genericLabel'} if (interpolator not in accepted_interpolators): raise ValueError(('interpolator not supported - see %s' % accepted_interpolators)) args = [fixed, moving, transformlist, interpolator] if (not isinstance(fixed, str)): if (isinstance(fixed, iio.ANTsImage) and isinstance(moving, iio.ANTsImage)): for tl_path in transformlist: if (not os.path.exists(tl_path)): raise Exception(('Transform %s does not exist' % tl_path)) inpixeltype = fixed.pixeltype fixed = fixed.clone('float') moving = moving.clone('float') warpedmovout = moving.clone() f = fixed m = moving if ((moving.dimension == 4) and (fixed.dimension == 3) and (imagetype == 0)): raise Exception('Set imagetype 3 to transform time series images.') wmo = warpedmovout mytx = [] if ((whichtoinvert is None) or (isinstance(whichtoinvert, (tuple, list)) and (sum([(w is not None) for w in whichtoinvert]) == 0))): if ((len(transformlist) == 2) and ('.mat' in transformlist[0]) and ('.mat' not in transformlist[1])): whichtoinvert = (True, False) else: whichtoinvert = tuple(([False] * len(transformlist))) if (len(whichtoinvert) != len(transformlist)): raise ValueError('Transform list and inversion list must be the same length') for i in range(len(transformlist)): ismat = False if ('.mat' in transformlist[0]): ismat = True if (whichtoinvert[i] and (not ismat)): raise ValueError(('Cannot invert transform %i (%s) because it is not a matrix' % (i, transformlist[i]))) if whichtoinvert[i]: mytx = (mytx + ['-t', ('[%s,1]' % transformlist[i])]) else: mytx = (mytx + ['-t', transformlist[i]]) if (compose is None): args = ['-d', fixed.dimension, '-i', m, '-o', wmo, '-r', f, '-n', interpolator] args = (args + mytx) tfn = (('%scomptx.nii.gz' % compose) if (compose is not None) else 'NA') if (compose is not None): mycompo = ('[%s,1]' % tfn) args = ['-d', fixed.dimension, '-i', m, '-o', mycompo, '-r', f, '-n', interpolator] args = (args + mytx) myargs = utils._int_antsProcessArguments(args) for jj in range(len(myargs)): if (myargs[jj] is not None): if (myargs[jj] == '-'): myargs2 = ([None] * (len(myargs) - 1)) myargs2[:(jj - 1)] = myargs[:(jj - 1)] myargs2[jj:(len(myargs) - 1)] = myargs[(jj + 1):len(myargs)] myargs = myargs2 myverb = int(verbose) if verbose: print(myargs) processed_args = (myargs + ['-z', str(1), '-v', str(myverb), '--float', str(1), '-e', str(imagetype)]) libfn = utils.get_lib_fn('antsApplyTransforms') libfn(processed_args) if (compose is None): return warpedmovout.clone(inpixeltype) elif os.path.exists(tfn): return tfn else: return None else: return 1 else: args = (args + ['-z', 1, '--float', 1, '-e', imagetype]) processed_args = utils._int_antsProcessArguments(args) libfn = utils.get_lib_fn('antsApplyTransforms') libfn(processed_args)
def apply_transforms(fixed, moving, transformlist, interpolator='linear', imagetype=0, whichtoinvert=None, compose=None, verbose=False, **kwargs): "\n Apply a transform list to map an image from one domain to another. \n In image registration, one computes mappings between (usually) pairs \n of images. These transforms are often a sequence of increasingly \n complex maps, e.g. from translation, to rigid, to affine to deformation. \n The list of such transforms is passed to this function to interpolate one \n image domain into the next image domain, as below. The order matters \n strongly and the user is advised to familiarize with the standards \n established in examples.\n\n ANTsR function: `antsApplyTransforms`\n\n Arguments\n ---------\n fixed : ANTsImage\n fixed image defining domain into which the moving image is transformed.\n \n moving : AntsImage\n moving image to be mapped to fixed space.\n \n transformlist : list of strings \n list of transforms generated by ants.registration where each transform is a filename.\n \n interpolator : string \n Choice of interpolator. Supports partial matching.\n linear\n nearestNeighbor\n multiLabel for label images but genericlabel is preferred\n gaussian\n bSpline\n cosineWindowedSinc\n welchWindowedSinc\n hammingWindowedSinc\n lanczosWindowedSinc\n genericLabel use this for label images\n \n imagetype : integer \n choose 0/1/2/3 mapping to scalar/vector/tensor/time-series\n \n whichtoinvert : list of booleans (optional) \n Must be same length as transformlist.\n whichtoinvert[i] is True if transformlist[i] is a matrix, \n and the matrix should be inverted. If transformlist[i] is a \n warp field, whichtoinvert[i] must be False.\n If the transform list is a matrix followed by a warp field, \n whichtoinvert defaults to (True,False). Otherwise it defaults \n to [False]*len(transformlist)).\n \n compose : string (optional)\n if it is a string pointing to a valid file location, \n this will force the function to return a composite transformation filename.\n \n verbose : boolean\n print command and run verbose application of transform.\n \n kwargs : keyword arguments \n extra parameters\n \n Returns\n -------\n ANTsImage or string (transformation filename)\n\n Example\n -------\n >>> import ants\n >>> fixed = ants.image_read( ants.get_ants_data('r16') )\n >>> moving = ants.image_read( ants.get_ants_data('r64') )\n >>> fixed = ants.resample_image(fixed, (64,64), 1, 0)\n >>> moving = ants.resample_image(moving, (64,64), 1, 0)\n >>> mytx = ants.registration(fixed=fixed , moving=moving ,\n type_of_transform = 'SyN' )\n >>> mywarpedimage = ants.apply_transforms( fixed=fixed, moving=moving,\n transformlist=mytx['fwdtransforms'] )\n " if ((not isinstance(transformlist, (tuple, list))) and (transformlist is not None)): transformlist = [transformlist] accepted_interpolators = {'linear', 'nearestNeighbor', 'multiLabel', 'gaussian', 'bSpline', 'cosineWindowedSinc', 'welchWindowedSinc', 'hammingWindowedSinc', 'lanczosWindowedSinc', 'genericLabel'} if (interpolator not in accepted_interpolators): raise ValueError(('interpolator not supported - see %s' % accepted_interpolators)) args = [fixed, moving, transformlist, interpolator] if (not isinstance(fixed, str)): if (isinstance(fixed, iio.ANTsImage) and isinstance(moving, iio.ANTsImage)): for tl_path in transformlist: if (not os.path.exists(tl_path)): raise Exception(('Transform %s does not exist' % tl_path)) inpixeltype = fixed.pixeltype fixed = fixed.clone('float') moving = moving.clone('float') warpedmovout = moving.clone() f = fixed m = moving if ((moving.dimension == 4) and (fixed.dimension == 3) and (imagetype == 0)): raise Exception('Set imagetype 3 to transform time series images.') wmo = warpedmovout mytx = [] if ((whichtoinvert is None) or (isinstance(whichtoinvert, (tuple, list)) and (sum([(w is not None) for w in whichtoinvert]) == 0))): if ((len(transformlist) == 2) and ('.mat' in transformlist[0]) and ('.mat' not in transformlist[1])): whichtoinvert = (True, False) else: whichtoinvert = tuple(([False] * len(transformlist))) if (len(whichtoinvert) != len(transformlist)): raise ValueError('Transform list and inversion list must be the same length') for i in range(len(transformlist)): ismat = False if ('.mat' in transformlist[0]): ismat = True if (whichtoinvert[i] and (not ismat)): raise ValueError(('Cannot invert transform %i (%s) because it is not a matrix' % (i, transformlist[i]))) if whichtoinvert[i]: mytx = (mytx + ['-t', ('[%s,1]' % transformlist[i])]) else: mytx = (mytx + ['-t', transformlist[i]]) if (compose is None): args = ['-d', fixed.dimension, '-i', m, '-o', wmo, '-r', f, '-n', interpolator] args = (args + mytx) tfn = (('%scomptx.nii.gz' % compose) if (compose is not None) else 'NA') if (compose is not None): mycompo = ('[%s,1]' % tfn) args = ['-d', fixed.dimension, '-i', m, '-o', mycompo, '-r', f, '-n', interpolator] args = (args + mytx) myargs = utils._int_antsProcessArguments(args) for jj in range(len(myargs)): if (myargs[jj] is not None): if (myargs[jj] == '-'): myargs2 = ([None] * (len(myargs) - 1)) myargs2[:(jj - 1)] = myargs[:(jj - 1)] myargs2[jj:(len(myargs) - 1)] = myargs[(jj + 1):len(myargs)] myargs = myargs2 myverb = int(verbose) if verbose: print(myargs) processed_args = (myargs + ['-z', str(1), '-v', str(myverb), '--float', str(1), '-e', str(imagetype)]) libfn = utils.get_lib_fn('antsApplyTransforms') libfn(processed_args) if (compose is None): return warpedmovout.clone(inpixeltype) elif os.path.exists(tfn): return tfn else: return None else: return 1 else: args = (args + ['-z', 1, '--float', 1, '-e', imagetype]) processed_args = utils._int_antsProcessArguments(args) libfn = utils.get_lib_fn('antsApplyTransforms') libfn(processed_args)<|docstring|>Apply a transform list to map an image from one domain to another. In image registration, one computes mappings between (usually) pairs of images. These transforms are often a sequence of increasingly complex maps, e.g. from translation, to rigid, to affine to deformation. The list of such transforms is passed to this function to interpolate one image domain into the next image domain, as below. The order matters strongly and the user is advised to familiarize with the standards established in examples. ANTsR function: `antsApplyTransforms` Arguments --------- fixed : ANTsImage fixed image defining domain into which the moving image is transformed. moving : AntsImage moving image to be mapped to fixed space. transformlist : list of strings list of transforms generated by ants.registration where each transform is a filename. interpolator : string Choice of interpolator. Supports partial matching. linear nearestNeighbor multiLabel for label images but genericlabel is preferred gaussian bSpline cosineWindowedSinc welchWindowedSinc hammingWindowedSinc lanczosWindowedSinc genericLabel use this for label images imagetype : integer choose 0/1/2/3 mapping to scalar/vector/tensor/time-series whichtoinvert : list of booleans (optional) Must be same length as transformlist. whichtoinvert[i] is True if transformlist[i] is a matrix, and the matrix should be inverted. If transformlist[i] is a warp field, whichtoinvert[i] must be False. If the transform list is a matrix followed by a warp field, whichtoinvert defaults to (True,False). Otherwise it defaults to [False]*len(transformlist)). compose : string (optional) if it is a string pointing to a valid file location, this will force the function to return a composite transformation filename. verbose : boolean print command and run verbose application of transform. kwargs : keyword arguments extra parameters Returns ------- ANTsImage or string (transformation filename) Example ------- >>> import ants >>> fixed = ants.image_read( ants.get_ants_data('r16') ) >>> moving = ants.image_read( ants.get_ants_data('r64') ) >>> fixed = ants.resample_image(fixed, (64,64), 1, 0) >>> moving = ants.resample_image(moving, (64,64), 1, 0) >>> mytx = ants.registration(fixed=fixed , moving=moving , type_of_transform = 'SyN' ) >>> mywarpedimage = ants.apply_transforms( fixed=fixed, moving=moving, transformlist=mytx['fwdtransforms'] )<|endoftext|>
3b6eecd96d14de07c16d3a4b46d410afd9728c2fc73a050062045ed58602f261
def test20(self): 'SDT()' self.assertEqual(repr(SDT()), 'SDT()')
SDT()
sdt_metrics/tests/test__sdt_metrics.py
test20
rogerlew/sdt-metrics
2
python
def test20(self): self.assertEqual(repr(), )
def test20(self): self.assertEqual(repr(), )<|docstring|>SDT()<|endoftext|>
1904fd3e9bc65fa2aaf3373fa5754a042ba2dcdf6c9146077f410687d7d39bee
def test21(self): 'SDT(mapping)' D = SDT(dict([(HI, 10), (CR, 9), (MI, 1)])) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
SDT(mapping)
sdt_metrics/tests/test__sdt_metrics.py
test21
rogerlew/sdt-metrics
2
python
def test21(self): D = SDT(dict([(HI, 10), (CR, 9), (MI, 1)])) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
def test21(self): D = SDT(dict([(HI, 10), (CR, 9), (MI, 1)])) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')<|docstring|>SDT(mapping)<|endoftext|>
e078e4f46b80d11de6632d6d740d998bb90b0ceca2aba7521436911e081d6052
def test22(self): 'SDT(iterable)' D = SDT([(HI, 10), (CR, 9), (MI, 1)]) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
SDT(iterable)
sdt_metrics/tests/test__sdt_metrics.py
test22
rogerlew/sdt-metrics
2
python
def test22(self): D = SDT([(HI, 10), (CR, 9), (MI, 1)]) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
def test22(self): D = SDT([(HI, 10), (CR, 9), (MI, 1)]) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')<|docstring|>SDT(iterable)<|endoftext|>
95dcf4aae0ca5f4e15bf1a2cd109224636fd26beceb83661807fb2f9505286b9
def test23(self): 'SDT(**kwargs)' D = SDT(HI=10, MI=1, CR=9) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
SDT(**kwargs)
sdt_metrics/tests/test__sdt_metrics.py
test23
rogerlew/sdt-metrics
2
python
def test23(self): D = SDT(HI=10, MI=1, CR=9) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
def test23(self): D = SDT(HI=10, MI=1, CR=9) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')<|docstring|>SDT(**kwargs)<|endoftext|>
4db1f6ea0a44fb00d95fa3363fa85125ef6191183c878ef5f37af77cf69565a1
def test24(self): 'SDT(iterable)' D = SDT([HI, HI, HI, FA, FA]) self.assertEqual(repr(D), 'SDT(HI=3, MI=0, CR=0, FA=2)')
SDT(iterable)
sdt_metrics/tests/test__sdt_metrics.py
test24
rogerlew/sdt-metrics
2
python
def test24(self): D = SDT([HI, HI, HI, FA, FA]) self.assertEqual(repr(D), 'SDT(HI=3, MI=0, CR=0, FA=2)')
def test24(self): D = SDT([HI, HI, HI, FA, FA]) self.assertEqual(repr(D), 'SDT(HI=3, MI=0, CR=0, FA=2)')<|docstring|>SDT(iterable)<|endoftext|>
cdc363b61d1a30a3e88b7755def46f816399023077b14eecc506e00b345003db
def test25(self): 'SDT(iterable, **kwargs), with overlapping key/values' D = SDT(dict([(HI, 10), (CR, 9)]), MI=1) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
SDT(iterable, **kwargs), with overlapping key/values
sdt_metrics/tests/test__sdt_metrics.py
test25
rogerlew/sdt-metrics
2
python
def test25(self): D = SDT(dict([(HI, 10), (CR, 9)]), MI=1) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
def test25(self): D = SDT(dict([(HI, 10), (CR, 9)]), MI=1) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')<|docstring|>SDT(iterable, **kwargs), with overlapping key/values<|endoftext|>
4924d66b17067cbf772a722e9e87d62fc89a5ff107e5cd1bc0f3026dc41d5973
def test99(self): 'Make sure that direct calls to update\n do not clear previous contents' D = SDT(dict([(HI, 10), (CR, 9)])) D.__init__(MI=1) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
Make sure that direct calls to update do not clear previous contents
sdt_metrics/tests/test__sdt_metrics.py
test99
rogerlew/sdt-metrics
2
python
def test99(self): 'Make sure that direct calls to update\n do not clear previous contents' D = SDT(dict([(HI, 10), (CR, 9)])) D.__init__(MI=1) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')
def test99(self): 'Make sure that direct calls to update\n do not clear previous contents' D = SDT(dict([(HI, 10), (CR, 9)])) D.__init__(MI=1) self.assertEqual(repr(D), 'SDT(HI=10, MI=1, CR=9, FA=0)')<|docstring|>Make sure that direct calls to update do not clear previous contents<|endoftext|>
5e4363c7ca4959fec3766843d20fdc98606761a129240fed0865ea772af9b378
def test20(self): 'SDT()' D = SDT() D.subtract() self.assertEqual(repr(D), 'SDT()')
SDT()
sdt_metrics/tests/test__sdt_metrics.py
test20
rogerlew/sdt-metrics
2
python
def test20(self): D = D.subtract() self.assertEqual(repr(D), )
def test20(self): D = D.subtract() self.assertEqual(repr(D), )<|docstring|>SDT()<|endoftext|>
e958e103dbc4e7b72f9e48ed0c3f6e83909d3f00e6ff3c8672a846f918d11153
def test21(self): 'SDT(mapping)' D = SDT() D.subtract(dict([(HI, 10), (CR, 9), (MI, 1)])) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')
SDT(mapping)
sdt_metrics/tests/test__sdt_metrics.py
test21
rogerlew/sdt-metrics
2
python
def test21(self): D = SDT() D.subtract(dict([(HI, 10), (CR, 9), (MI, 1)])) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')
def test21(self): D = SDT() D.subtract(dict([(HI, 10), (CR, 9), (MI, 1)])) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')<|docstring|>SDT(mapping)<|endoftext|>
bab3533369b7640ac17b09f51a50688678e7883c891d577ae5b9a38b7cceb87d
def test22(self): 'SDT(iterable)' D = SDT() D.subtract([(HI, 10), (CR, 9), (MI, 1)]) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')
SDT(iterable)
sdt_metrics/tests/test__sdt_metrics.py
test22
rogerlew/sdt-metrics
2
python
def test22(self): D = SDT() D.subtract([(HI, 10), (CR, 9), (MI, 1)]) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')
def test22(self): D = SDT() D.subtract([(HI, 10), (CR, 9), (MI, 1)]) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')<|docstring|>SDT(iterable)<|endoftext|>
600605804eb85c19a3fdb9cf966d50491cec4a8e3e462e1b00e57eade840f866
def test23(self): 'SDT(**kwargs)' D = SDT() D.subtract(HI=10, MI=1, CR=9) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')
SDT(**kwargs)
sdt_metrics/tests/test__sdt_metrics.py
test23
rogerlew/sdt-metrics
2
python
def test23(self): D = SDT() D.subtract(HI=10, MI=1, CR=9) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')
def test23(self): D = SDT() D.subtract(HI=10, MI=1, CR=9) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')<|docstring|>SDT(**kwargs)<|endoftext|>
ea48e62a2fa84f16d2ca31b6cbc5ef784fe300d2226a05736d2b2ecb2785caca
def test25(self): 'SDT(iterable, **kwargs), with overlapping key/values' D = SDT() D.subtract(dict([(HI, 10), (CR, 9)]), MI=1) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')
SDT(iterable, **kwargs), with overlapping key/values
sdt_metrics/tests/test__sdt_metrics.py
test25
rogerlew/sdt-metrics
2
python
def test25(self): D = SDT() D.subtract(dict([(HI, 10), (CR, 9)]), MI=1) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')
def test25(self): D = SDT() D.subtract(dict([(HI, 10), (CR, 9)]), MI=1) self.assertEqual(repr(D), 'SDT(HI=-10, MI=-1, CR=-9, FA=0)')<|docstring|>SDT(iterable, **kwargs), with overlapping key/values<|endoftext|>
393ef8d267cde71d5f97aad8633316130e18743159eb7d71d9d062a2ac2cb378
def test26(self): 'SDT(iterable, **kwargs), with overlapping key/values' D = SDT(dict([(HI, 10), (CR, 9)]), MI=1) D.update([HI, HI, HI, FA, FA]) self.assertEqual(repr(D), 'SDT(HI=13, MI=1, CR=9, FA=2)')
SDT(iterable, **kwargs), with overlapping key/values
sdt_metrics/tests/test__sdt_metrics.py
test26
rogerlew/sdt-metrics
2
python
def test26(self): D = SDT(dict([(HI, 10), (CR, 9)]), MI=1) D.update([HI, HI, HI, FA, FA]) self.assertEqual(repr(D), 'SDT(HI=13, MI=1, CR=9, FA=2)')
def test26(self): D = SDT(dict([(HI, 10), (CR, 9)]), MI=1) D.update([HI, HI, HI, FA, FA]) self.assertEqual(repr(D), 'SDT(HI=13, MI=1, CR=9, FA=2)')<|docstring|>SDT(iterable, **kwargs), with overlapping key/values<|endoftext|>
7de3fcadc3fff637536e37770d7da9f67a899cbfdd2b5e1ee32937d8ed5e1b9d
def test0(self): 'float args' self.assertEqual(aprime.direct(12, 3, 4, 34), SDT(HI=12, MI=3, CR=4, FA=34).aprime())
float args
sdt_metrics/tests/test__sdt_metrics.py
test0
rogerlew/sdt-metrics
2
python
def test0(self): self.assertEqual(aprime.direct(12, 3, 4, 34), SDT(HI=12, MI=3, CR=4, FA=34).aprime())
def test0(self): self.assertEqual(aprime.direct(12, 3, 4, 34), SDT(HI=12, MI=3, CR=4, FA=34).aprime())<|docstring|>float args<|endoftext|>
f64a71ca38e070cf62296f6d145d16159996a7fc12c39cf87284e77b74f95f22
def test1(self): 'list args' R = [SDT(HI=12, MI=3, CR=4, FA=34).aprime(), SDT(HI=12, MI=3, CR=4, FA=4).aprime()] D = aprime.direct([12, 12], [3, 3], [4, 4], [34, 4]) for (r, d) in zip(R, D): self.assertAlmostEqual(r, d, 7)
list args
sdt_metrics/tests/test__sdt_metrics.py
test1
rogerlew/sdt-metrics
2
python
def test1(self): R = [SDT(HI=12, MI=3, CR=4, FA=34).aprime(), SDT(HI=12, MI=3, CR=4, FA=4).aprime()] D = aprime.direct([12, 12], [3, 3], [4, 4], [34, 4]) for (r, d) in zip(R, D): self.assertAlmostEqual(r, d, 7)
def test1(self): R = [SDT(HI=12, MI=3, CR=4, FA=34).aprime(), SDT(HI=12, MI=3, CR=4, FA=4).aprime()] D = aprime.direct([12, 12], [3, 3], [4, 4], [34, 4]) for (r, d) in zip(R, D): self.assertAlmostEqual(r, d, 7)<|docstring|>list args<|endoftext|>
b76ece9fe947b5e9a4bcceee8182f1274ad3f175187848717c10dedb3c25deed
def test0(self): 'float args' self.assertEqual(aprime.prob((12 / 15.0), (34 / 38.0)), SDT(HI=12, MI=3, CR=4, FA=34).aprime())
float args
sdt_metrics/tests/test__sdt_metrics.py
test0
rogerlew/sdt-metrics
2
python
def test0(self): self.assertEqual(aprime.prob((12 / 15.0), (34 / 38.0)), SDT(HI=12, MI=3, CR=4, FA=34).aprime())
def test0(self): self.assertEqual(aprime.prob((12 / 15.0), (34 / 38.0)), SDT(HI=12, MI=3, CR=4, FA=34).aprime())<|docstring|>float args<|endoftext|>
445367e7c7e5a7cc5108c0e950709f12575e875d1fe61e7d21544a564fddcb70
def test1(self): 'list args' R = [SDT(HI=12, MI=3, CR=4, FA=34).aprime(), SDT(HI=12, MI=3, CR=4, FA=4).aprime()] D = aprime.prob([(12 / 15.0), (12 / 15.0)], [(34 / 38.0), (4 / 8.0)]) for (r, d) in zip(R, D): self.assertAlmostEqual(r, d, 7)
list args
sdt_metrics/tests/test__sdt_metrics.py
test1
rogerlew/sdt-metrics
2
python
def test1(self): R = [SDT(HI=12, MI=3, CR=4, FA=34).aprime(), SDT(HI=12, MI=3, CR=4, FA=4).aprime()] D = aprime.prob([(12 / 15.0), (12 / 15.0)], [(34 / 38.0), (4 / 8.0)]) for (r, d) in zip(R, D): self.assertAlmostEqual(r, d, 7)
def test1(self): R = [SDT(HI=12, MI=3, CR=4, FA=34).aprime(), SDT(HI=12, MI=3, CR=4, FA=4).aprime()] D = aprime.prob([(12 / 15.0), (12 / 15.0)], [(34 / 38.0), (4 / 8.0)]) for (r, d) in zip(R, D): self.assertAlmostEqual(r, d, 7)<|docstring|>list args<|endoftext|>
0f01f87baff1c2295b02819a3fb338fd37e68dc4b5c0a744d55c07a736671e81
def test2(self): 'test _prob binding' self.assertEqual(hasattr(mutual_info, 'prob'), False)
test _prob binding
sdt_metrics/tests/test__sdt_metrics.py
test2
rogerlew/sdt-metrics
2
python
def test2(self): self.assertEqual(hasattr(mutual_info, 'prob'), False)
def test2(self): self.assertEqual(hasattr(mutual_info, 'prob'), False)<|docstring|>test _prob binding<|endoftext|>
97bb8e5cab6defa5167afd6c15c566e83c83270b1f125b38726f69295dce90bd
def test1(self): 'given an SDT object' sdt = SDT(HI=116, MI=30, CR=323, FA=80) sdt_metrics.plotting.poc_plot(sdt)
given an SDT object
sdt_metrics/tests/test__sdt_metrics.py
test1
rogerlew/sdt-metrics
2
python
def test1(self): sdt = SDT(HI=116, MI=30, CR=323, FA=80) sdt_metrics.plotting.poc_plot(sdt)
def test1(self): sdt = SDT(HI=116, MI=30, CR=323, FA=80) sdt_metrics.plotting.poc_plot(sdt)<|docstring|>given an SDT object<|endoftext|>
c907d11b4da8e48098e1e256c91c9249d16be7b35beea27964c292db0da05952
def test2(self): 'given probabilities' sdt_metrics.plotting.poc_plot(0.67, 0.43)
given probabilities
sdt_metrics/tests/test__sdt_metrics.py
test2
rogerlew/sdt-metrics
2
python
def test2(self): sdt_metrics.plotting.poc_plot(0.67, 0.43)
def test2(self): sdt_metrics.plotting.poc_plot(0.67, 0.43)<|docstring|>given probabilities<|endoftext|>
ab626af3acac97cbfa4bf69309753f48937d2fd27e6ada39be25a7c1d6643158
def test3(self): 'given an counts' sdt_metrics.plotting.poc_plot(116, 30, 50, 50)
given an counts
sdt_metrics/tests/test__sdt_metrics.py
test3
rogerlew/sdt-metrics
2
python
def test3(self): sdt_metrics.plotting.poc_plot(116, 30, 50, 50)
def test3(self): sdt_metrics.plotting.poc_plot(116, 30, 50, 50)<|docstring|>given an counts<|endoftext|>
b13cc62627a2883989c135beaa582f53085804f055927f574e86346c34d334a9
def test1(self): 'given an SDT object' sdt = SDT(HI=116, MI=30, CR=323, FA=80) sdt_metrics.plotting.roc_plot(sdt)
given an SDT object
sdt_metrics/tests/test__sdt_metrics.py
test1
rogerlew/sdt-metrics
2
python
def test1(self): sdt = SDT(HI=116, MI=30, CR=323, FA=80) sdt_metrics.plotting.roc_plot(sdt)
def test1(self): sdt = SDT(HI=116, MI=30, CR=323, FA=80) sdt_metrics.plotting.roc_plot(sdt)<|docstring|>given an SDT object<|endoftext|>
742f835f90b3c4157e6e9aaebaaad3b7ed262d637f6e8fd066edd3a50eb06f98
def test2(self): 'given probabilities' sdt_metrics.plotting.roc_plot(0.67, 0.43, metric='amzs', fname='roc_example01.png')
given probabilities
sdt_metrics/tests/test__sdt_metrics.py
test2
rogerlew/sdt-metrics
2
python
def test2(self): sdt_metrics.plotting.roc_plot(0.67, 0.43, metric='amzs', fname='roc_example01.png')
def test2(self): sdt_metrics.plotting.roc_plot(0.67, 0.43, metric='amzs', fname='roc_example01.png')<|docstring|>given probabilities<|endoftext|>
05057432b2c80244f7a197f9900dbef5fe32e22258d7bfd18e8c20aca3af347a
def test3(self): 'given an counts' sdt_metrics.plotting.roc_plot(116, 30, 50, 50, metric='aprime', fname='roc_example02.png')
given an counts
sdt_metrics/tests/test__sdt_metrics.py
test3
rogerlew/sdt-metrics
2
python
def test3(self): sdt_metrics.plotting.roc_plot(116, 30, 50, 50, metric='aprime', fname='roc_example02.png')
def test3(self): sdt_metrics.plotting.roc_plot(116, 30, 50, 50, metric='aprime', fname='roc_example02.png')<|docstring|>given an counts<|endoftext|>
af30292a78303bd8cbaaf37785422e0983e4a047fb499a5b6bca0958a38d218b
def test4(self): 'given SDT object' sdt_metrics.plotting.roc_plot(SDT(HI=251, MI=245, CR=264, FA=240), fname='roc_example03.png')
given SDT object
sdt_metrics/tests/test__sdt_metrics.py
test4
rogerlew/sdt-metrics
2
python
def test4(self): sdt_metrics.plotting.roc_plot(SDT(HI=251, MI=245, CR=264, FA=240), fname='roc_example03.png')
def test4(self): sdt_metrics.plotting.roc_plot(SDT(HI=251, MI=245, CR=264, FA=240), fname='roc_example03.png')<|docstring|>given SDT object<|endoftext|>
b9fd9ae4cb8094b2da1f5a2fd94d305cff73a3a058b9e58badbc535930853dd2
def test4(self): 'given isopleth' sdt_metrics.plotting.roc_plot(116, 30, 50, 50, metric='dprime', isopleths='beta', fname='roc_example04.png')
given isopleth
sdt_metrics/tests/test__sdt_metrics.py
test4
rogerlew/sdt-metrics
2
python
def test4(self): sdt_metrics.plotting.roc_plot(116, 30, 50, 50, metric='dprime', isopleths='beta', fname='roc_example04.png')
def test4(self): sdt_metrics.plotting.roc_plot(116, 30, 50, 50, metric='dprime', isopleths='beta', fname='roc_example04.png')<|docstring|>given isopleth<|endoftext|>
dfbc0678dae84b9615a9f1ec502dd4266f1cac74e57b934e3ec6c53da38241ae
def __init__(self, id=None, name=None, type=None, organization=None, created_by=None, created_at=None, local_token=None, automated_project_settings=None): 'ConnectorDto - a model defined in Swagger' self._id = None self._name = None self._type = None self._organization = None self._created_by = None self._created_at = None self._local_token = None self._automated_project_settings = None self.discriminator = None if (id is not None): self.id = id if (name is not None): self.name = name if (type is not None): self.type = type if (organization is not None): self.organization = organization if (created_by is not None): self.created_by = created_by if (created_at is not None): self.created_at = created_at if (local_token is not None): self.local_token = local_token if (automated_project_settings is not None): self.automated_project_settings = automated_project_settings
ConnectorDto - a model defined in Swagger
memsource_cli/models/connector_dto.py
__init__
unofficial-memsource/memsource-cli-client
16
python
def __init__(self, id=None, name=None, type=None, organization=None, created_by=None, created_at=None, local_token=None, automated_project_settings=None): self._id = None self._name = None self._type = None self._organization = None self._created_by = None self._created_at = None self._local_token = None self._automated_project_settings = None self.discriminator = None if (id is not None): self.id = id if (name is not None): self.name = name if (type is not None): self.type = type if (organization is not None): self.organization = organization if (created_by is not None): self.created_by = created_by if (created_at is not None): self.created_at = created_at if (local_token is not None): self.local_token = local_token if (automated_project_settings is not None): self.automated_project_settings = automated_project_settings
def __init__(self, id=None, name=None, type=None, organization=None, created_by=None, created_at=None, local_token=None, automated_project_settings=None): self._id = None self._name = None self._type = None self._organization = None self._created_by = None self._created_at = None self._local_token = None self._automated_project_settings = None self.discriminator = None if (id is not None): self.id = id if (name is not None): self.name = name if (type is not None): self.type = type if (organization is not None): self.organization = organization if (created_by is not None): self.created_by = created_by if (created_at is not None): self.created_at = created_at if (local_token is not None): self.local_token = local_token if (automated_project_settings is not None): self.automated_project_settings = automated_project_settings<|docstring|>ConnectorDto - a model defined in Swagger<|endoftext|>
85d936216b6a7f6d4fc446f35eaf5a71c88b5c2991827c7aecb9ebc46e0091d5
@property def id(self): 'Gets the id of this ConnectorDto. # noqa: E501\n\n\n :return: The id of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._id
Gets the id of this ConnectorDto. # noqa: E501 :return: The id of this ConnectorDto. # noqa: E501 :rtype: str
memsource_cli/models/connector_dto.py
id
unofficial-memsource/memsource-cli-client
16
python
@property def id(self): 'Gets the id of this ConnectorDto. # noqa: E501\n\n\n :return: The id of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._id
@property def id(self): 'Gets the id of this ConnectorDto. # noqa: E501\n\n\n :return: The id of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._id<|docstring|>Gets the id of this ConnectorDto. # noqa: E501 :return: The id of this ConnectorDto. # noqa: E501 :rtype: str<|endoftext|>
37f682a3fe7e2b615c1da9c5e64f10ad100abe2f52a26dfffb4b62b42a3e7aa9
@id.setter def id(self, id): 'Sets the id of this ConnectorDto.\n\n\n :param id: The id of this ConnectorDto. # noqa: E501\n :type: str\n ' self._id = id
Sets the id of this ConnectorDto. :param id: The id of this ConnectorDto. # noqa: E501 :type: str
memsource_cli/models/connector_dto.py
id
unofficial-memsource/memsource-cli-client
16
python
@id.setter def id(self, id): 'Sets the id of this ConnectorDto.\n\n\n :param id: The id of this ConnectorDto. # noqa: E501\n :type: str\n ' self._id = id
@id.setter def id(self, id): 'Sets the id of this ConnectorDto.\n\n\n :param id: The id of this ConnectorDto. # noqa: E501\n :type: str\n ' self._id = id<|docstring|>Sets the id of this ConnectorDto. :param id: The id of this ConnectorDto. # noqa: E501 :type: str<|endoftext|>
aa1aa50ea5592aa8fc76b3547be9ee2a88108529423db8ba196606ecfc938a8e
@property def name(self): 'Gets the name of this ConnectorDto. # noqa: E501\n\n\n :return: The name of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._name
Gets the name of this ConnectorDto. # noqa: E501 :return: The name of this ConnectorDto. # noqa: E501 :rtype: str
memsource_cli/models/connector_dto.py
name
unofficial-memsource/memsource-cli-client
16
python
@property def name(self): 'Gets the name of this ConnectorDto. # noqa: E501\n\n\n :return: The name of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._name
@property def name(self): 'Gets the name of this ConnectorDto. # noqa: E501\n\n\n :return: The name of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._name<|docstring|>Gets the name of this ConnectorDto. # noqa: E501 :return: The name of this ConnectorDto. # noqa: E501 :rtype: str<|endoftext|>
e3472001f18ab69697a558b5183bf19067b7b03a80017c1f6af6f4c9e47b675e
@name.setter def name(self, name): 'Sets the name of this ConnectorDto.\n\n\n :param name: The name of this ConnectorDto. # noqa: E501\n :type: str\n ' self._name = name
Sets the name of this ConnectorDto. :param name: The name of this ConnectorDto. # noqa: E501 :type: str
memsource_cli/models/connector_dto.py
name
unofficial-memsource/memsource-cli-client
16
python
@name.setter def name(self, name): 'Sets the name of this ConnectorDto.\n\n\n :param name: The name of this ConnectorDto. # noqa: E501\n :type: str\n ' self._name = name
@name.setter def name(self, name): 'Sets the name of this ConnectorDto.\n\n\n :param name: The name of this ConnectorDto. # noqa: E501\n :type: str\n ' self._name = name<|docstring|>Sets the name of this ConnectorDto. :param name: The name of this ConnectorDto. # noqa: E501 :type: str<|endoftext|>
2dd48d2efbf834caef36584364cf91faf07c2de095e9c69815f20ddc6f82b0d9
@property def type(self): 'Gets the type of this ConnectorDto. # noqa: E501\n\n\n :return: The type of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._type
Gets the type of this ConnectorDto. # noqa: E501 :return: The type of this ConnectorDto. # noqa: E501 :rtype: str
memsource_cli/models/connector_dto.py
type
unofficial-memsource/memsource-cli-client
16
python
@property def type(self): 'Gets the type of this ConnectorDto. # noqa: E501\n\n\n :return: The type of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._type
@property def type(self): 'Gets the type of this ConnectorDto. # noqa: E501\n\n\n :return: The type of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._type<|docstring|>Gets the type of this ConnectorDto. # noqa: E501 :return: The type of this ConnectorDto. # noqa: E501 :rtype: str<|endoftext|>
44afd1a53184faca01cac11d63894ba37bc0785f9940117e0ccf02114873f715
@type.setter def type(self, type): 'Sets the type of this ConnectorDto.\n\n\n :param type: The type of this ConnectorDto. # noqa: E501\n :type: str\n ' allowed_values = ['DROPBOX', 'GOOGLE', 'FTP', 'WORDPRESS', 'GITHUB', 'SFTP', 'DRUPAL', 'BOX', 'GIT', 'ZENDESK', 'ONEDRIVE', 'GITLAB', 'MARKETO', 'HUBSPOT', 'HELPSCOUT', 'SALESFORCE', 'BITBUCKET', 'BITBUCKETSERVER', 'SHAREPOINT', 'AZURE', 'SITECORE', 'KENTICO', 'MAGENTO', 'CONTENTFULENTRYLEVEL', 'CONTENTFUL', 'CONTENTSTACK', 'JOOMLA', 'CONFLUENCE', 'TYPO3', 'AEM_PLUGIN'] if (type not in allowed_values): raise ValueError('Invalid value for `type` ({0}), must be one of {1}'.format(type, allowed_values)) self._type = type
Sets the type of this ConnectorDto. :param type: The type of this ConnectorDto. # noqa: E501 :type: str
memsource_cli/models/connector_dto.py
type
unofficial-memsource/memsource-cli-client
16
python
@type.setter def type(self, type): 'Sets the type of this ConnectorDto.\n\n\n :param type: The type of this ConnectorDto. # noqa: E501\n :type: str\n ' allowed_values = ['DROPBOX', 'GOOGLE', 'FTP', 'WORDPRESS', 'GITHUB', 'SFTP', 'DRUPAL', 'BOX', 'GIT', 'ZENDESK', 'ONEDRIVE', 'GITLAB', 'MARKETO', 'HUBSPOT', 'HELPSCOUT', 'SALESFORCE', 'BITBUCKET', 'BITBUCKETSERVER', 'SHAREPOINT', 'AZURE', 'SITECORE', 'KENTICO', 'MAGENTO', 'CONTENTFULENTRYLEVEL', 'CONTENTFUL', 'CONTENTSTACK', 'JOOMLA', 'CONFLUENCE', 'TYPO3', 'AEM_PLUGIN'] if (type not in allowed_values): raise ValueError('Invalid value for `type` ({0}), must be one of {1}'.format(type, allowed_values)) self._type = type
@type.setter def type(self, type): 'Sets the type of this ConnectorDto.\n\n\n :param type: The type of this ConnectorDto. # noqa: E501\n :type: str\n ' allowed_values = ['DROPBOX', 'GOOGLE', 'FTP', 'WORDPRESS', 'GITHUB', 'SFTP', 'DRUPAL', 'BOX', 'GIT', 'ZENDESK', 'ONEDRIVE', 'GITLAB', 'MARKETO', 'HUBSPOT', 'HELPSCOUT', 'SALESFORCE', 'BITBUCKET', 'BITBUCKETSERVER', 'SHAREPOINT', 'AZURE', 'SITECORE', 'KENTICO', 'MAGENTO', 'CONTENTFULENTRYLEVEL', 'CONTENTFUL', 'CONTENTSTACK', 'JOOMLA', 'CONFLUENCE', 'TYPO3', 'AEM_PLUGIN'] if (type not in allowed_values): raise ValueError('Invalid value for `type` ({0}), must be one of {1}'.format(type, allowed_values)) self._type = type<|docstring|>Sets the type of this ConnectorDto. :param type: The type of this ConnectorDto. # noqa: E501 :type: str<|endoftext|>
d79e7be45dd519625d9ef04ad97ea4e01fc7fc415e0ea68478e67a3f1b3fa13c
@property def organization(self): 'Gets the organization of this ConnectorDto. # noqa: E501\n\n\n :return: The organization of this ConnectorDto. # noqa: E501\n :rtype: NameDto\n ' return self._organization
Gets the organization of this ConnectorDto. # noqa: E501 :return: The organization of this ConnectorDto. # noqa: E501 :rtype: NameDto
memsource_cli/models/connector_dto.py
organization
unofficial-memsource/memsource-cli-client
16
python
@property def organization(self): 'Gets the organization of this ConnectorDto. # noqa: E501\n\n\n :return: The organization of this ConnectorDto. # noqa: E501\n :rtype: NameDto\n ' return self._organization
@property def organization(self): 'Gets the organization of this ConnectorDto. # noqa: E501\n\n\n :return: The organization of this ConnectorDto. # noqa: E501\n :rtype: NameDto\n ' return self._organization<|docstring|>Gets the organization of this ConnectorDto. # noqa: E501 :return: The organization of this ConnectorDto. # noqa: E501 :rtype: NameDto<|endoftext|>
5aff6e70abfff84fbe99bb754e3d536f64a573b17447d7438ace77cecc0fc5c3
@organization.setter def organization(self, organization): 'Sets the organization of this ConnectorDto.\n\n\n :param organization: The organization of this ConnectorDto. # noqa: E501\n :type: NameDto\n ' self._organization = organization
Sets the organization of this ConnectorDto. :param organization: The organization of this ConnectorDto. # noqa: E501 :type: NameDto
memsource_cli/models/connector_dto.py
organization
unofficial-memsource/memsource-cli-client
16
python
@organization.setter def organization(self, organization): 'Sets the organization of this ConnectorDto.\n\n\n :param organization: The organization of this ConnectorDto. # noqa: E501\n :type: NameDto\n ' self._organization = organization
@organization.setter def organization(self, organization): 'Sets the organization of this ConnectorDto.\n\n\n :param organization: The organization of this ConnectorDto. # noqa: E501\n :type: NameDto\n ' self._organization = organization<|docstring|>Sets the organization of this ConnectorDto. :param organization: The organization of this ConnectorDto. # noqa: E501 :type: NameDto<|endoftext|>
d47e5881338849b78b9fa7c227b996826e187e106962b0d1874b9632058ed82b
@property def created_by(self): 'Gets the created_by of this ConnectorDto. # noqa: E501\n\n\n :return: The created_by of this ConnectorDto. # noqa: E501\n :rtype: NameDto\n ' return self._created_by
Gets the created_by of this ConnectorDto. # noqa: E501 :return: The created_by of this ConnectorDto. # noqa: E501 :rtype: NameDto
memsource_cli/models/connector_dto.py
created_by
unofficial-memsource/memsource-cli-client
16
python
@property def created_by(self): 'Gets the created_by of this ConnectorDto. # noqa: E501\n\n\n :return: The created_by of this ConnectorDto. # noqa: E501\n :rtype: NameDto\n ' return self._created_by
@property def created_by(self): 'Gets the created_by of this ConnectorDto. # noqa: E501\n\n\n :return: The created_by of this ConnectorDto. # noqa: E501\n :rtype: NameDto\n ' return self._created_by<|docstring|>Gets the created_by of this ConnectorDto. # noqa: E501 :return: The created_by of this ConnectorDto. # noqa: E501 :rtype: NameDto<|endoftext|>
e9376bf01ad5ba4f03aff8ca0db7a6d2609d6b43b755f81c3142a40d61b7dcc6
@created_by.setter def created_by(self, created_by): 'Sets the created_by of this ConnectorDto.\n\n\n :param created_by: The created_by of this ConnectorDto. # noqa: E501\n :type: NameDto\n ' self._created_by = created_by
Sets the created_by of this ConnectorDto. :param created_by: The created_by of this ConnectorDto. # noqa: E501 :type: NameDto
memsource_cli/models/connector_dto.py
created_by
unofficial-memsource/memsource-cli-client
16
python
@created_by.setter def created_by(self, created_by): 'Sets the created_by of this ConnectorDto.\n\n\n :param created_by: The created_by of this ConnectorDto. # noqa: E501\n :type: NameDto\n ' self._created_by = created_by
@created_by.setter def created_by(self, created_by): 'Sets the created_by of this ConnectorDto.\n\n\n :param created_by: The created_by of this ConnectorDto. # noqa: E501\n :type: NameDto\n ' self._created_by = created_by<|docstring|>Sets the created_by of this ConnectorDto. :param created_by: The created_by of this ConnectorDto. # noqa: E501 :type: NameDto<|endoftext|>
86fb75df521c3aa1df8b53dc1544c678c8ce1b50bd2ce5cb382e8049ab380a20
@property def created_at(self): 'Gets the created_at of this ConnectorDto. # noqa: E501\n\n\n :return: The created_at of this ConnectorDto. # noqa: E501\n :rtype: datetime\n ' return self._created_at
Gets the created_at of this ConnectorDto. # noqa: E501 :return: The created_at of this ConnectorDto. # noqa: E501 :rtype: datetime
memsource_cli/models/connector_dto.py
created_at
unofficial-memsource/memsource-cli-client
16
python
@property def created_at(self): 'Gets the created_at of this ConnectorDto. # noqa: E501\n\n\n :return: The created_at of this ConnectorDto. # noqa: E501\n :rtype: datetime\n ' return self._created_at
@property def created_at(self): 'Gets the created_at of this ConnectorDto. # noqa: E501\n\n\n :return: The created_at of this ConnectorDto. # noqa: E501\n :rtype: datetime\n ' return self._created_at<|docstring|>Gets the created_at of this ConnectorDto. # noqa: E501 :return: The created_at of this ConnectorDto. # noqa: E501 :rtype: datetime<|endoftext|>
01c7a38ab9e7ec71d7a10331cba134aac753d6a8a0d30bcdd60f4e610720370f
@created_at.setter def created_at(self, created_at): 'Sets the created_at of this ConnectorDto.\n\n\n :param created_at: The created_at of this ConnectorDto. # noqa: E501\n :type: datetime\n ' self._created_at = created_at
Sets the created_at of this ConnectorDto. :param created_at: The created_at of this ConnectorDto. # noqa: E501 :type: datetime
memsource_cli/models/connector_dto.py
created_at
unofficial-memsource/memsource-cli-client
16
python
@created_at.setter def created_at(self, created_at): 'Sets the created_at of this ConnectorDto.\n\n\n :param created_at: The created_at of this ConnectorDto. # noqa: E501\n :type: datetime\n ' self._created_at = created_at
@created_at.setter def created_at(self, created_at): 'Sets the created_at of this ConnectorDto.\n\n\n :param created_at: The created_at of this ConnectorDto. # noqa: E501\n :type: datetime\n ' self._created_at = created_at<|docstring|>Sets the created_at of this ConnectorDto. :param created_at: The created_at of this ConnectorDto. # noqa: E501 :type: datetime<|endoftext|>
b2736258839602b30aed4fe44038af8f263c828a2418cef44638a690f53fe84d
@property def local_token(self): 'Gets the local_token of this ConnectorDto. # noqa: E501\n\n\n :return: The local_token of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._local_token
Gets the local_token of this ConnectorDto. # noqa: E501 :return: The local_token of this ConnectorDto. # noqa: E501 :rtype: str
memsource_cli/models/connector_dto.py
local_token
unofficial-memsource/memsource-cli-client
16
python
@property def local_token(self): 'Gets the local_token of this ConnectorDto. # noqa: E501\n\n\n :return: The local_token of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._local_token
@property def local_token(self): 'Gets the local_token of this ConnectorDto. # noqa: E501\n\n\n :return: The local_token of this ConnectorDto. # noqa: E501\n :rtype: str\n ' return self._local_token<|docstring|>Gets the local_token of this ConnectorDto. # noqa: E501 :return: The local_token of this ConnectorDto. # noqa: E501 :rtype: str<|endoftext|>
46e28415729144c8746c218f7dfc9c82628f6a990fec9e8d7df9333780498cde
@local_token.setter def local_token(self, local_token): 'Sets the local_token of this ConnectorDto.\n\n\n :param local_token: The local_token of this ConnectorDto. # noqa: E501\n :type: str\n ' self._local_token = local_token
Sets the local_token of this ConnectorDto. :param local_token: The local_token of this ConnectorDto. # noqa: E501 :type: str
memsource_cli/models/connector_dto.py
local_token
unofficial-memsource/memsource-cli-client
16
python
@local_token.setter def local_token(self, local_token): 'Sets the local_token of this ConnectorDto.\n\n\n :param local_token: The local_token of this ConnectorDto. # noqa: E501\n :type: str\n ' self._local_token = local_token
@local_token.setter def local_token(self, local_token): 'Sets the local_token of this ConnectorDto.\n\n\n :param local_token: The local_token of this ConnectorDto. # noqa: E501\n :type: str\n ' self._local_token = local_token<|docstring|>Sets the local_token of this ConnectorDto. :param local_token: The local_token of this ConnectorDto. # noqa: E501 :type: str<|endoftext|>
21895dda28d9bf2b0fbde1fb879a76797495179976edff3b18fec22c4446332e
@property def automated_project_settings(self): 'Gets the automated_project_settings of this ConnectorDto. # noqa: E501\n\n\n :return: The automated_project_settings of this ConnectorDto. # noqa: E501\n :rtype: list[AutomatedProjectSettingsDto]\n ' return self._automated_project_settings
Gets the automated_project_settings of this ConnectorDto. # noqa: E501 :return: The automated_project_settings of this ConnectorDto. # noqa: E501 :rtype: list[AutomatedProjectSettingsDto]
memsource_cli/models/connector_dto.py
automated_project_settings
unofficial-memsource/memsource-cli-client
16
python
@property def automated_project_settings(self): 'Gets the automated_project_settings of this ConnectorDto. # noqa: E501\n\n\n :return: The automated_project_settings of this ConnectorDto. # noqa: E501\n :rtype: list[AutomatedProjectSettingsDto]\n ' return self._automated_project_settings
@property def automated_project_settings(self): 'Gets the automated_project_settings of this ConnectorDto. # noqa: E501\n\n\n :return: The automated_project_settings of this ConnectorDto. # noqa: E501\n :rtype: list[AutomatedProjectSettingsDto]\n ' return self._automated_project_settings<|docstring|>Gets the automated_project_settings of this ConnectorDto. # noqa: E501 :return: The automated_project_settings of this ConnectorDto. # noqa: E501 :rtype: list[AutomatedProjectSettingsDto]<|endoftext|>
9bf1205f6223204b13356f665b825049d5e8eae32659d71c4436538b3ebccc3b
@automated_project_settings.setter def automated_project_settings(self, automated_project_settings): 'Sets the automated_project_settings of this ConnectorDto.\n\n\n :param automated_project_settings: The automated_project_settings of this ConnectorDto. # noqa: E501\n :type: list[AutomatedProjectSettingsDto]\n ' self._automated_project_settings = automated_project_settings
Sets the automated_project_settings of this ConnectorDto. :param automated_project_settings: The automated_project_settings of this ConnectorDto. # noqa: E501 :type: list[AutomatedProjectSettingsDto]
memsource_cli/models/connector_dto.py
automated_project_settings
unofficial-memsource/memsource-cli-client
16
python
@automated_project_settings.setter def automated_project_settings(self, automated_project_settings): 'Sets the automated_project_settings of this ConnectorDto.\n\n\n :param automated_project_settings: The automated_project_settings of this ConnectorDto. # noqa: E501\n :type: list[AutomatedProjectSettingsDto]\n ' self._automated_project_settings = automated_project_settings
@automated_project_settings.setter def automated_project_settings(self, automated_project_settings): 'Sets the automated_project_settings of this ConnectorDto.\n\n\n :param automated_project_settings: The automated_project_settings of this ConnectorDto. # noqa: E501\n :type: list[AutomatedProjectSettingsDto]\n ' self._automated_project_settings = automated_project_settings<|docstring|>Sets the automated_project_settings of this ConnectorDto. :param automated_project_settings: The automated_project_settings of this ConnectorDto. # noqa: E501 :type: list[AutomatedProjectSettingsDto]<|endoftext|>
2c655fe2921c5f86981218a73b2cb99a72afc68c2a2352dc3e9127f441042a1a
def to_dict(self): 'Returns the model properties as a dict' result = {} for (attr, _) in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value)) elif hasattr(value, 'to_dict'): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map((lambda item: ((item[0], item[1].to_dict()) if hasattr(item[1], 'to_dict') else item)), value.items())) else: result[attr] = value if issubclass(ConnectorDto, dict): for (key, value) in self.items(): result[key] = value return result
Returns the model properties as a dict
memsource_cli/models/connector_dto.py
to_dict
unofficial-memsource/memsource-cli-client
16
python
def to_dict(self): result = {} for (attr, _) in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value)) elif hasattr(value, 'to_dict'): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map((lambda item: ((item[0], item[1].to_dict()) if hasattr(item[1], 'to_dict') else item)), value.items())) else: result[attr] = value if issubclass(ConnectorDto, dict): for (key, value) in self.items(): result[key] = value return result
def to_dict(self): result = {} for (attr, _) in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value)) elif hasattr(value, 'to_dict'): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map((lambda item: ((item[0], item[1].to_dict()) if hasattr(item[1], 'to_dict') else item)), value.items())) else: result[attr] = value if issubclass(ConnectorDto, dict): for (key, value) in self.items(): result[key] = value return result<|docstring|>Returns the model properties as a dict<|endoftext|>
cbb19eaa2fc8a113d9e32f924ef280a7e97563f8915f94f65dab438997af2e99
def to_str(self): 'Returns the string representation of the model' return pprint.pformat(self.to_dict())
Returns the string representation of the model
memsource_cli/models/connector_dto.py
to_str
unofficial-memsource/memsource-cli-client
16
python
def to_str(self): return pprint.pformat(self.to_dict())
def to_str(self): return pprint.pformat(self.to_dict())<|docstring|>Returns the string representation of the model<|endoftext|>
772243a2c2b3261a9b954d07aaf295e3c1242a579a495e2d6a5679c677861703
def __repr__(self): 'For `print` and `pprint`' return self.to_str()
For `print` and `pprint`
memsource_cli/models/connector_dto.py
__repr__
unofficial-memsource/memsource-cli-client
16
python
def __repr__(self): return self.to_str()
def __repr__(self): return self.to_str()<|docstring|>For `print` and `pprint`<|endoftext|>
435fdeec4df2b5adea52e4d3ed64c08491b48301df82ffda98f7a359c5cc739f
def __eq__(self, other): 'Returns true if both objects are equal' if (not isinstance(other, ConnectorDto)): return False return (self.__dict__ == other.__dict__)
Returns true if both objects are equal
memsource_cli/models/connector_dto.py
__eq__
unofficial-memsource/memsource-cli-client
16
python
def __eq__(self, other): if (not isinstance(other, ConnectorDto)): return False return (self.__dict__ == other.__dict__)
def __eq__(self, other): if (not isinstance(other, ConnectorDto)): return False return (self.__dict__ == other.__dict__)<|docstring|>Returns true if both objects are equal<|endoftext|>
43dc6740163eb9fc1161d09cb2208a64c7ad0cc8d9c8637ac3264522d3ec7e42
def __ne__(self, other): 'Returns true if both objects are not equal' return (not (self == other))
Returns true if both objects are not equal
memsource_cli/models/connector_dto.py
__ne__
unofficial-memsource/memsource-cli-client
16
python
def __ne__(self, other): return (not (self == other))
def __ne__(self, other): return (not (self == other))<|docstring|>Returns true if both objects are not equal<|endoftext|>
5875f1c57b381bfd56dd7ae36b3e08ebf9500797cc74a144c88859ad7a03d889
def function(arg1, arg2, kwarg1=1): '_summary_\n\n :param arg1: _description_\n :type arg1: _type_\n :param arg2: _description_\n :type arg2: _type_\n :param kwarg1: _description_, defaults to 1\n :type kwarg1: int, optional\n :raises FileExistsError: _description_\n :return: _description_\n :rtype: _type_\n :yield: _description_\n :rtype: _type_\n ' if (arg2 > 1): raise FileExistsError() (yield 1) return arg1
_summary_ :param arg1: _description_ :type arg1: _type_ :param arg2: _description_ :type arg2: _type_ :param kwarg1: _description_, defaults to 1 :type kwarg1: int, optional :raises FileExistsError: _description_ :return: _description_ :rtype: _type_ :yield: _description_ :rtype: _type_
src/test/integration/python_test_files/file_1_output.py
function
sv1990/autoDocstring
0
python
def function(arg1, arg2, kwarg1=1): '_summary_\n\n :param arg1: _description_\n :type arg1: _type_\n :param arg2: _description_\n :type arg2: _type_\n :param kwarg1: _description_, defaults to 1\n :type kwarg1: int, optional\n :raises FileExistsError: _description_\n :return: _description_\n :rtype: _type_\n :yield: _description_\n :rtype: _type_\n ' if (arg2 > 1): raise FileExistsError() (yield 1) return arg1
def function(arg1, arg2, kwarg1=1): '_summary_\n\n :param arg1: _description_\n :type arg1: _type_\n :param arg2: _description_\n :type arg2: _type_\n :param kwarg1: _description_, defaults to 1\n :type kwarg1: int, optional\n :raises FileExistsError: _description_\n :return: _description_\n :rtype: _type_\n :yield: _description_\n :rtype: _type_\n ' if (arg2 > 1): raise FileExistsError() (yield 1) return arg1<|docstring|>_summary_ :param arg1: _description_ :type arg1: _type_ :param arg2: _description_ :type arg2: _type_ :param kwarg1: _description_, defaults to 1 :type kwarg1: int, optional :raises FileExistsError: _description_ :return: _description_ :rtype: _type_ :yield: _description_ :rtype: _type_<|endoftext|>
57815e4d7fbf9ffb2b40779300fedb15498d5026a1d3608f964264019fb0101e
def SymmetricFunctionAlgebra(R, basis='schur'): "\n This is deprecated in :trac:`15473`. Use instead\n :class:`SymmetricFunctions` as ``SymmetricFunctions(R).basis()``\n\n INPUT:\n\n - ``R`` -- ring with identity basis\n - ``basis`` -- a string for the name of the basis, must be one of\n 'schur', 'elementary', 'homogeneous', 'power', 'monomial' or their\n abbreviations 's', 'e', 'h', 'p', 'm'\n\n OUTPUT: A SymmetricFunctionAlgebra\n\n EXAMPLES::\n\n sage: SymmetricFunctionAlgebra(QQ)\n doctest:...: DeprecationWarning: this function is deprecated. Use SymmetricFunctions(R).basis()\n See http://trac.sagemath.org/15473 for details.\n Symmetric Functions over Rational Field in the Schur basis\n " sage.misc.superseded.deprecation(15473, 'this function is deprecated. Use SymmetricFunctions(R).basis()') from sage.combinat.sf.sf import SymmetricFunctions Sym = SymmetricFunctions(R) if ((basis == 'schur') or (basis == 's')): return Sym.s() elif ((basis == 'elementary') or (basis == 'e')): return Sym.e() elif ((basis == 'homogeneous') or (basis == 'h')): return Sym.h() elif ((basis == 'power') or (basis == 'p')): return Sym.p() elif ((basis == 'monomial') or (basis == 'm')): return Sym.m() else: raise ValueError(('unknown basis (= %s)' % basis))
This is deprecated in :trac:`15473`. Use instead :class:`SymmetricFunctions` as ``SymmetricFunctions(R).basis()`` INPUT: - ``R`` -- ring with identity basis - ``basis`` -- a string for the name of the basis, must be one of 'schur', 'elementary', 'homogeneous', 'power', 'monomial' or their abbreviations 's', 'e', 'h', 'p', 'm' OUTPUT: A SymmetricFunctionAlgebra EXAMPLES:: sage: SymmetricFunctionAlgebra(QQ) doctest:...: DeprecationWarning: this function is deprecated. Use SymmetricFunctions(R).basis() See http://trac.sagemath.org/15473 for details. Symmetric Functions over Rational Field in the Schur basis
src/sage/combinat/sf/sfa.py
SymmetricFunctionAlgebra
bopopescu/sagesmc
5
python
def SymmetricFunctionAlgebra(R, basis='schur'): "\n This is deprecated in :trac:`15473`. Use instead\n :class:`SymmetricFunctions` as ``SymmetricFunctions(R).basis()``\n\n INPUT:\n\n - ``R`` -- ring with identity basis\n - ``basis`` -- a string for the name of the basis, must be one of\n 'schur', 'elementary', 'homogeneous', 'power', 'monomial' or their\n abbreviations 's', 'e', 'h', 'p', 'm'\n\n OUTPUT: A SymmetricFunctionAlgebra\n\n EXAMPLES::\n\n sage: SymmetricFunctionAlgebra(QQ)\n doctest:...: DeprecationWarning: this function is deprecated. Use SymmetricFunctions(R).basis()\n See http://trac.sagemath.org/15473 for details.\n Symmetric Functions over Rational Field in the Schur basis\n " sage.misc.superseded.deprecation(15473, 'this function is deprecated. Use SymmetricFunctions(R).basis()') from sage.combinat.sf.sf import SymmetricFunctions Sym = SymmetricFunctions(R) if ((basis == 'schur') or (basis == 's')): return Sym.s() elif ((basis == 'elementary') or (basis == 'e')): return Sym.e() elif ((basis == 'homogeneous') or (basis == 'h')): return Sym.h() elif ((basis == 'power') or (basis == 'p')): return Sym.p() elif ((basis == 'monomial') or (basis == 'm')): return Sym.m() else: raise ValueError(('unknown basis (= %s)' % basis))
def SymmetricFunctionAlgebra(R, basis='schur'): "\n This is deprecated in :trac:`15473`. Use instead\n :class:`SymmetricFunctions` as ``SymmetricFunctions(R).basis()``\n\n INPUT:\n\n - ``R`` -- ring with identity basis\n - ``basis`` -- a string for the name of the basis, must be one of\n 'schur', 'elementary', 'homogeneous', 'power', 'monomial' or their\n abbreviations 's', 'e', 'h', 'p', 'm'\n\n OUTPUT: A SymmetricFunctionAlgebra\n\n EXAMPLES::\n\n sage: SymmetricFunctionAlgebra(QQ)\n doctest:...: DeprecationWarning: this function is deprecated. Use SymmetricFunctions(R).basis()\n See http://trac.sagemath.org/15473 for details.\n Symmetric Functions over Rational Field in the Schur basis\n " sage.misc.superseded.deprecation(15473, 'this function is deprecated. Use SymmetricFunctions(R).basis()') from sage.combinat.sf.sf import SymmetricFunctions Sym = SymmetricFunctions(R) if ((basis == 'schur') or (basis == 's')): return Sym.s() elif ((basis == 'elementary') or (basis == 'e')): return Sym.e() elif ((basis == 'homogeneous') or (basis == 'h')): return Sym.h() elif ((basis == 'power') or (basis == 'p')): return Sym.p() elif ((basis == 'monomial') or (basis == 'm')): return Sym.m() else: raise ValueError(('unknown basis (= %s)' % basis))<|docstring|>This is deprecated in :trac:`15473`. Use instead :class:`SymmetricFunctions` as ``SymmetricFunctions(R).basis()`` INPUT: - ``R`` -- ring with identity basis - ``basis`` -- a string for the name of the basis, must be one of 'schur', 'elementary', 'homogeneous', 'power', 'monomial' or their abbreviations 's', 'e', 'h', 'p', 'm' OUTPUT: A SymmetricFunctionAlgebra EXAMPLES:: sage: SymmetricFunctionAlgebra(QQ) doctest:...: DeprecationWarning: this function is deprecated. Use SymmetricFunctions(R).basis() See http://trac.sagemath.org/15473 for details. Symmetric Functions over Rational Field in the Schur basis<|endoftext|>
556713846b0ef813fcd72d7f1ee85d3a699ea9934cc113c4745698147f429cab
def is_SymmetricFunctionAlgebra(x): "\n Checks whether ``x`` is a symmetric function algebra.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import is_SymmetricFunctionAlgebra\n sage: is_SymmetricFunctionAlgebra(5)\n False\n sage: is_SymmetricFunctionAlgebra(ZZ)\n False\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(ZZ).schur())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).e())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).macdonald(q=1,t=1).P())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(FractionField(QQ['q','t'])).macdonald().P())\n True\n " return isinstance(x, SymmetricFunctionAlgebra_generic)
Checks whether ``x`` is a symmetric function algebra. EXAMPLES:: sage: from sage.combinat.sf.sfa import is_SymmetricFunctionAlgebra sage: is_SymmetricFunctionAlgebra(5) False sage: is_SymmetricFunctionAlgebra(ZZ) False sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(ZZ).schur()) True sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).e()) True sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).macdonald(q=1,t=1).P()) True sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(FractionField(QQ['q','t'])).macdonald().P()) True
src/sage/combinat/sf/sfa.py
is_SymmetricFunctionAlgebra
bopopescu/sagesmc
5
python
def is_SymmetricFunctionAlgebra(x): "\n Checks whether ``x`` is a symmetric function algebra.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import is_SymmetricFunctionAlgebra\n sage: is_SymmetricFunctionAlgebra(5)\n False\n sage: is_SymmetricFunctionAlgebra(ZZ)\n False\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(ZZ).schur())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).e())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).macdonald(q=1,t=1).P())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(FractionField(QQ['q','t'])).macdonald().P())\n True\n " return isinstance(x, SymmetricFunctionAlgebra_generic)
def is_SymmetricFunctionAlgebra(x): "\n Checks whether ``x`` is a symmetric function algebra.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import is_SymmetricFunctionAlgebra\n sage: is_SymmetricFunctionAlgebra(5)\n False\n sage: is_SymmetricFunctionAlgebra(ZZ)\n False\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(ZZ).schur())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).e())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).macdonald(q=1,t=1).P())\n True\n sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(FractionField(QQ['q','t'])).macdonald().P())\n True\n " return isinstance(x, SymmetricFunctionAlgebra_generic)<|docstring|>Checks whether ``x`` is a symmetric function algebra. EXAMPLES:: sage: from sage.combinat.sf.sfa import is_SymmetricFunctionAlgebra sage: is_SymmetricFunctionAlgebra(5) False sage: is_SymmetricFunctionAlgebra(ZZ) False sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(ZZ).schur()) True sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).e()) True sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(QQ).macdonald(q=1,t=1).P()) True sage: is_SymmetricFunctionAlgebra(SymmetricFunctions(FractionField(QQ['q','t'])).macdonald().P()) True<|endoftext|>
86ccddf9f598ed3b4ca77ac9963a5c33455e5283381610aa3baf277ac69c4595
def zee(part): '\n Return the size of the centralizer of permutations of cycle type ``part``.\n\n Note that the size of the centralizer is the inner product between `p(part)` and\n itself where `p` is the power-sum symmetric functions.\n\n INPUT:\n\n - ``part`` -- an integer partition (for example, [2,1,1])\n\n OUTPUT:\n\n - the integer `\\prod_{i} i^{m_i(part)} m_i(part)!` where `m_i(part)` is\n the number of parts in the partition ``part`` equal to `i`\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import zee\n sage: zee([2,1,1])\n 4\n ' if (not isinstance(part, sage.combinat.partition.Partition)): part = sage.combinat.partition.Partition(part) return part.centralizer_size()
Return the size of the centralizer of permutations of cycle type ``part``. Note that the size of the centralizer is the inner product between `p(part)` and itself where `p` is the power-sum symmetric functions. INPUT: - ``part`` -- an integer partition (for example, [2,1,1]) OUTPUT: - the integer `\prod_{i} i^{m_i(part)} m_i(part)!` where `m_i(part)` is the number of parts in the partition ``part`` equal to `i` EXAMPLES:: sage: from sage.combinat.sf.sfa import zee sage: zee([2,1,1]) 4
src/sage/combinat/sf/sfa.py
zee
bopopescu/sagesmc
5
python
def zee(part): '\n Return the size of the centralizer of permutations of cycle type ``part``.\n\n Note that the size of the centralizer is the inner product between `p(part)` and\n itself where `p` is the power-sum symmetric functions.\n\n INPUT:\n\n - ``part`` -- an integer partition (for example, [2,1,1])\n\n OUTPUT:\n\n - the integer `\\prod_{i} i^{m_i(part)} m_i(part)!` where `m_i(part)` is\n the number of parts in the partition ``part`` equal to `i`\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import zee\n sage: zee([2,1,1])\n 4\n ' if (not isinstance(part, sage.combinat.partition.Partition)): part = sage.combinat.partition.Partition(part) return part.centralizer_size()
def zee(part): '\n Return the size of the centralizer of permutations of cycle type ``part``.\n\n Note that the size of the centralizer is the inner product between `p(part)` and\n itself where `p` is the power-sum symmetric functions.\n\n INPUT:\n\n - ``part`` -- an integer partition (for example, [2,1,1])\n\n OUTPUT:\n\n - the integer `\\prod_{i} i^{m_i(part)} m_i(part)!` where `m_i(part)` is\n the number of parts in the partition ``part`` equal to `i`\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import zee\n sage: zee([2,1,1])\n 4\n ' if (not isinstance(part, sage.combinat.partition.Partition)): part = sage.combinat.partition.Partition(part) return part.centralizer_size()<|docstring|>Return the size of the centralizer of permutations of cycle type ``part``. Note that the size of the centralizer is the inner product between `p(part)` and itself where `p` is the power-sum symmetric functions. INPUT: - ``part`` -- an integer partition (for example, [2,1,1]) OUTPUT: - the integer `\prod_{i} i^{m_i(part)} m_i(part)!` where `m_i(part)` is the number of parts in the partition ``part`` equal to `i` EXAMPLES:: sage: from sage.combinat.sf.sfa import zee sage: zee([2,1,1]) 4<|endoftext|>
0de71fb3fcca5d1022e4b1ca41b64b659015a54f8a95c3e084a9480f02f462b4
def is_SymmetricFunction(x): '\n Checks whether ``x`` is a symmetric function.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import is_SymmetricFunction\n sage: s = SymmetricFunctions(QQ).s()\n sage: is_SymmetricFunction(2)\n False\n sage: is_SymmetricFunction(s(2))\n True\n sage: is_SymmetricFunction(s([2,1]))\n True\n ' return isinstance(x, SymmetricFunctionAlgebra_generic.Element)
Checks whether ``x`` is a symmetric function. EXAMPLES:: sage: from sage.combinat.sf.sfa import is_SymmetricFunction sage: s = SymmetricFunctions(QQ).s() sage: is_SymmetricFunction(2) False sage: is_SymmetricFunction(s(2)) True sage: is_SymmetricFunction(s([2,1])) True
src/sage/combinat/sf/sfa.py
is_SymmetricFunction
bopopescu/sagesmc
5
python
def is_SymmetricFunction(x): '\n Checks whether ``x`` is a symmetric function.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import is_SymmetricFunction\n sage: s = SymmetricFunctions(QQ).s()\n sage: is_SymmetricFunction(2)\n False\n sage: is_SymmetricFunction(s(2))\n True\n sage: is_SymmetricFunction(s([2,1]))\n True\n ' return isinstance(x, SymmetricFunctionAlgebra_generic.Element)
def is_SymmetricFunction(x): '\n Checks whether ``x`` is a symmetric function.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import is_SymmetricFunction\n sage: s = SymmetricFunctions(QQ).s()\n sage: is_SymmetricFunction(2)\n False\n sage: is_SymmetricFunction(s(2))\n True\n sage: is_SymmetricFunction(s([2,1]))\n True\n ' return isinstance(x, SymmetricFunctionAlgebra_generic.Element)<|docstring|>Checks whether ``x`` is a symmetric function. EXAMPLES:: sage: from sage.combinat.sf.sfa import is_SymmetricFunction sage: s = SymmetricFunctions(QQ).s() sage: is_SymmetricFunction(2) False sage: is_SymmetricFunction(s(2)) True sage: is_SymmetricFunction(s([2,1])) True<|endoftext|>
0502fa79c3f675efac898dab26d70ebbf7aaaa278efa25d73beb3ecc7e8134bb
def _lmax(x): '\n Returns the max of ``x`` where ``x`` is a list.\n\n If ``x`` is the empty list, ``_lmax`` returns 0.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import _lmax\n sage: _lmax([3,2,1])\n 3\n sage: _lmax([])\n 0\n ' if (x == []): return 0 else: return max(x)
Returns the max of ``x`` where ``x`` is a list. If ``x`` is the empty list, ``_lmax`` returns 0. EXAMPLES:: sage: from sage.combinat.sf.sfa import _lmax sage: _lmax([3,2,1]) 3 sage: _lmax([]) 0
src/sage/combinat/sf/sfa.py
_lmax
bopopescu/sagesmc
5
python
def _lmax(x): '\n Returns the max of ``x`` where ``x`` is a list.\n\n If ``x`` is the empty list, ``_lmax`` returns 0.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import _lmax\n sage: _lmax([3,2,1])\n 3\n sage: _lmax([])\n 0\n ' if (x == []): return 0 else: return max(x)
def _lmax(x): '\n Returns the max of ``x`` where ``x`` is a list.\n\n If ``x`` is the empty list, ``_lmax`` returns 0.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import _lmax\n sage: _lmax([3,2,1])\n 3\n sage: _lmax([])\n 0\n ' if (x == []): return 0 else: return max(x)<|docstring|>Returns the max of ``x`` where ``x`` is a list. If ``x`` is the empty list, ``_lmax`` returns 0. EXAMPLES:: sage: from sage.combinat.sf.sfa import _lmax sage: _lmax([3,2,1]) 3 sage: _lmax([]) 0<|endoftext|>
8f9f08dfab5c77a80a6a6bb82da24f3b1b7be08fccb5cc4fe6789972ef345fa1
def _nonnegative_coefficients(x): '\n Returns ``True`` if ``x`` has nonnegative coefficients.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import _nonnegative_coefficients\n sage: _nonnegative_coefficients(2)\n True\n sage: _nonnegative_coefficients(-2)\n False\n sage: R.<x> = ZZ[]\n sage: _nonnegative_coefficients(x^2+4)\n True\n sage: _nonnegative_coefficients(x^2-4)\n False\n ' if (is_Polynomial(x) or is_MPolynomial(x)): return all([(c >= 0) for c in x.coeffs()]) else: return (x >= 0)
Returns ``True`` if ``x`` has nonnegative coefficients. EXAMPLES:: sage: from sage.combinat.sf.sfa import _nonnegative_coefficients sage: _nonnegative_coefficients(2) True sage: _nonnegative_coefficients(-2) False sage: R.<x> = ZZ[] sage: _nonnegative_coefficients(x^2+4) True sage: _nonnegative_coefficients(x^2-4) False
src/sage/combinat/sf/sfa.py
_nonnegative_coefficients
bopopescu/sagesmc
5
python
def _nonnegative_coefficients(x): '\n Returns ``True`` if ``x`` has nonnegative coefficients.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import _nonnegative_coefficients\n sage: _nonnegative_coefficients(2)\n True\n sage: _nonnegative_coefficients(-2)\n False\n sage: R.<x> = ZZ[]\n sage: _nonnegative_coefficients(x^2+4)\n True\n sage: _nonnegative_coefficients(x^2-4)\n False\n ' if (is_Polynomial(x) or is_MPolynomial(x)): return all([(c >= 0) for c in x.coeffs()]) else: return (x >= 0)
def _nonnegative_coefficients(x): '\n Returns ``True`` if ``x`` has nonnegative coefficients.\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import _nonnegative_coefficients\n sage: _nonnegative_coefficients(2)\n True\n sage: _nonnegative_coefficients(-2)\n False\n sage: R.<x> = ZZ[]\n sage: _nonnegative_coefficients(x^2+4)\n True\n sage: _nonnegative_coefficients(x^2-4)\n False\n ' if (is_Polynomial(x) or is_MPolynomial(x)): return all([(c >= 0) for c in x.coeffs()]) else: return (x >= 0)<|docstring|>Returns ``True`` if ``x`` has nonnegative coefficients. EXAMPLES:: sage: from sage.combinat.sf.sfa import _nonnegative_coefficients sage: _nonnegative_coefficients(2) True sage: _nonnegative_coefficients(-2) False sage: R.<x> = ZZ[] sage: _nonnegative_coefficients(x^2+4) True sage: _nonnegative_coefficients(x^2-4) False<|endoftext|>
d6005f07df18344bd6631f1b85262bef6292cd49b32e598cfdae9be1d1b7a7a6
def __init__(self, base): '\n Initialize the bases of the ring of symmetric functions.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n - ``base`` -- ring of symmetric functions\n\n TESTS::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym); bases\n Category of bases of Symmetric Functions over Rational Field\n sage: Sym.schur() in bases\n True\n ' Category_realization_of_parent.__init__(self, base)
Initialize the bases of the ring of symmetric functions. INPUT: - ``self`` -- a category of bases for the symmetric functions - ``base`` -- ring of symmetric functions TESTS:: sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases sage: Sym = SymmetricFunctions(QQ) sage: bases = SymmetricFunctionsBases(Sym); bases Category of bases of Symmetric Functions over Rational Field sage: Sym.schur() in bases True
src/sage/combinat/sf/sfa.py
__init__
bopopescu/sagesmc
5
python
def __init__(self, base): '\n Initialize the bases of the ring of symmetric functions.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n - ``base`` -- ring of symmetric functions\n\n TESTS::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym); bases\n Category of bases of Symmetric Functions over Rational Field\n sage: Sym.schur() in bases\n True\n ' Category_realization_of_parent.__init__(self, base)
def __init__(self, base): '\n Initialize the bases of the ring of symmetric functions.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n - ``base`` -- ring of symmetric functions\n\n TESTS::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym); bases\n Category of bases of Symmetric Functions over Rational Field\n sage: Sym.schur() in bases\n True\n ' Category_realization_of_parent.__init__(self, base)<|docstring|>Initialize the bases of the ring of symmetric functions. INPUT: - ``self`` -- a category of bases for the symmetric functions - ``base`` -- ring of symmetric functions TESTS:: sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases sage: Sym = SymmetricFunctions(QQ) sage: bases = SymmetricFunctionsBases(Sym); bases Category of bases of Symmetric Functions over Rational Field sage: Sym.schur() in bases True<|endoftext|>
3d65aa5b1b2f56eb50ccbee723d734d7972f7321d3ad85418514c582c316032b
def _repr_(self): "\n Returns the representation of ``self``.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym)\n sage: bases._repr_()\n 'Category of bases of Symmetric Functions over Rational Field'\n " return ('Category of bases of %s' % self.base())
Returns the representation of ``self``. INPUT: - ``self`` -- a category of bases for the symmetric functions EXAMPLES:: sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases sage: Sym = SymmetricFunctions(QQ) sage: bases = SymmetricFunctionsBases(Sym) sage: bases._repr_() 'Category of bases of Symmetric Functions over Rational Field'
src/sage/combinat/sf/sfa.py
_repr_
bopopescu/sagesmc
5
python
def _repr_(self): "\n Returns the representation of ``self``.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym)\n sage: bases._repr_()\n 'Category of bases of Symmetric Functions over Rational Field'\n " return ('Category of bases of %s' % self.base())
def _repr_(self): "\n Returns the representation of ``self``.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym)\n sage: bases._repr_()\n 'Category of bases of Symmetric Functions over Rational Field'\n " return ('Category of bases of %s' % self.base())<|docstring|>Returns the representation of ``self``. INPUT: - ``self`` -- a category of bases for the symmetric functions EXAMPLES:: sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases sage: Sym = SymmetricFunctions(QQ) sage: bases = SymmetricFunctionsBases(Sym) sage: bases._repr_() 'Category of bases of Symmetric Functions over Rational Field'<|endoftext|>
538828f3e5f7a9743ee37e30990396089405d1a76bed4ca419b8016c57cdd9e7
def super_categories(self): '\n The super categories of ``self``.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym)\n sage: bases.super_categories()\n [Category of graded hopf algebras with basis over Rational Field, Category of realizations of Symmetric Functions over Rational Field, Category of commutative rings]\n ' from sage.categories.all import CommutativeRings, GradedHopfAlgebrasWithBasis return [GradedHopfAlgebrasWithBasis(self.base().base_ring()), Realizations(self.base()), CommutativeRings()]
The super categories of ``self``. INPUT: - ``self`` -- a category of bases for the symmetric functions EXAMPLES:: sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases sage: Sym = SymmetricFunctions(QQ) sage: bases = SymmetricFunctionsBases(Sym) sage: bases.super_categories() [Category of graded hopf algebras with basis over Rational Field, Category of realizations of Symmetric Functions over Rational Field, Category of commutative rings]
src/sage/combinat/sf/sfa.py
super_categories
bopopescu/sagesmc
5
python
def super_categories(self): '\n The super categories of ``self``.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym)\n sage: bases.super_categories()\n [Category of graded hopf algebras with basis over Rational Field, Category of realizations of Symmetric Functions over Rational Field, Category of commutative rings]\n ' from sage.categories.all import CommutativeRings, GradedHopfAlgebrasWithBasis return [GradedHopfAlgebrasWithBasis(self.base().base_ring()), Realizations(self.base()), CommutativeRings()]
def super_categories(self): '\n The super categories of ``self``.\n\n INPUT:\n\n - ``self`` -- a category of bases for the symmetric functions\n\n EXAMPLES::\n\n sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases\n sage: Sym = SymmetricFunctions(QQ)\n sage: bases = SymmetricFunctionsBases(Sym)\n sage: bases.super_categories()\n [Category of graded hopf algebras with basis over Rational Field, Category of realizations of Symmetric Functions over Rational Field, Category of commutative rings]\n ' from sage.categories.all import CommutativeRings, GradedHopfAlgebrasWithBasis return [GradedHopfAlgebrasWithBasis(self.base().base_ring()), Realizations(self.base()), CommutativeRings()]<|docstring|>The super categories of ``self``. INPUT: - ``self`` -- a category of bases for the symmetric functions EXAMPLES:: sage: from sage.combinat.sf.sfa import SymmetricFunctionsBases sage: Sym = SymmetricFunctions(QQ) sage: bases = SymmetricFunctionsBases(Sym) sage: bases.super_categories() [Category of graded hopf algebras with basis over Rational Field, Category of realizations of Symmetric Functions over Rational Field, Category of commutative rings]<|endoftext|>
5bb87f55d68ff822272486e53ff716ba4072d9e06b044d723f5a48b6d459b9f6
def __init__(self, Sym, basis_name=None, prefix=None): '\n Initializes the symmetric function algebra.\n\n INPUT:\n\n - ``Sym`` -- the ring of symmetric functions\n - ``basis_name`` -- name of basis (default: ``None``)\n - ``prefix`` -- prefix used to display basis\n\n TESTS::\n\n sage: from sage.combinat.sf.classical import SymmetricFunctionAlgebra_classical\n sage: s = SymmetricFunctions(QQ).s()\n sage: isinstance(s, SymmetricFunctionAlgebra_classical)\n True\n sage: TestSuite(s).run()\n ' R = Sym.base_ring() from sage.categories.all import CommutativeRings if (R not in CommutativeRings()): raise TypeError('Argument R must be a commutative ring.') try: R(Integer(1)) except Exception: raise ValueError('R must have a unit element') if (basis_name is not None): self._basis = basis_name if (prefix is not None): self._prefix = prefix self._sym = Sym CombinatorialFreeModule.__init__(self, Sym.base_ring(), _Partitions, category=SymmetricFunctionsBases(Sym), bracket='', prefix=prefix)
Initializes the symmetric function algebra. INPUT: - ``Sym`` -- the ring of symmetric functions - ``basis_name`` -- name of basis (default: ``None``) - ``prefix`` -- prefix used to display basis TESTS:: sage: from sage.combinat.sf.classical import SymmetricFunctionAlgebra_classical sage: s = SymmetricFunctions(QQ).s() sage: isinstance(s, SymmetricFunctionAlgebra_classical) True sage: TestSuite(s).run()
src/sage/combinat/sf/sfa.py
__init__
bopopescu/sagesmc
5
python
def __init__(self, Sym, basis_name=None, prefix=None): '\n Initializes the symmetric function algebra.\n\n INPUT:\n\n - ``Sym`` -- the ring of symmetric functions\n - ``basis_name`` -- name of basis (default: ``None``)\n - ``prefix`` -- prefix used to display basis\n\n TESTS::\n\n sage: from sage.combinat.sf.classical import SymmetricFunctionAlgebra_classical\n sage: s = SymmetricFunctions(QQ).s()\n sage: isinstance(s, SymmetricFunctionAlgebra_classical)\n True\n sage: TestSuite(s).run()\n ' R = Sym.base_ring() from sage.categories.all import CommutativeRings if (R not in CommutativeRings()): raise TypeError('Argument R must be a commutative ring.') try: R(Integer(1)) except Exception: raise ValueError('R must have a unit element') if (basis_name is not None): self._basis = basis_name if (prefix is not None): self._prefix = prefix self._sym = Sym CombinatorialFreeModule.__init__(self, Sym.base_ring(), _Partitions, category=SymmetricFunctionsBases(Sym), bracket=, prefix=prefix)
def __init__(self, Sym, basis_name=None, prefix=None): '\n Initializes the symmetric function algebra.\n\n INPUT:\n\n - ``Sym`` -- the ring of symmetric functions\n - ``basis_name`` -- name of basis (default: ``None``)\n - ``prefix`` -- prefix used to display basis\n\n TESTS::\n\n sage: from sage.combinat.sf.classical import SymmetricFunctionAlgebra_classical\n sage: s = SymmetricFunctions(QQ).s()\n sage: isinstance(s, SymmetricFunctionAlgebra_classical)\n True\n sage: TestSuite(s).run()\n ' R = Sym.base_ring() from sage.categories.all import CommutativeRings if (R not in CommutativeRings()): raise TypeError('Argument R must be a commutative ring.') try: R(Integer(1)) except Exception: raise ValueError('R must have a unit element') if (basis_name is not None): self._basis = basis_name if (prefix is not None): self._prefix = prefix self._sym = Sym CombinatorialFreeModule.__init__(self, Sym.base_ring(), _Partitions, category=SymmetricFunctionsBases(Sym), bracket=, prefix=prefix)<|docstring|>Initializes the symmetric function algebra. INPUT: - ``Sym`` -- the ring of symmetric functions - ``basis_name`` -- name of basis (default: ``None``) - ``prefix`` -- prefix used to display basis TESTS:: sage: from sage.combinat.sf.classical import SymmetricFunctionAlgebra_classical sage: s = SymmetricFunctions(QQ).s() sage: isinstance(s, SymmetricFunctionAlgebra_classical) True sage: TestSuite(s).run()<|endoftext|>
01f61ddc7e56331fc506f3ab13caf8b9bf0dabfcb398ccf9df932e6e71fa350f
def __getitem__(self, c, *rest): "\n This method implements the abuses of notations ``p[2,1]``,\n ``p[[2,1]]``, ``p[Partition([2,1])]``.\n\n INPUT:\n\n - ``c`` -- a list, list of lists, or partition\n\n .. TODO::\n\n Should call ``super.term`` so as not to interfere with the\n standard notation ``p['x,y,z']``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s[2,1]\n s[2, 1]\n sage: s[[2,1]]\n s[2, 1]\n sage: s[Partition([2,1])]\n s[2, 1]\n " C = self.basis().keys() if isinstance(c, C.element_class): if (len(rest) != 0): raise ValueError('invalid number of arguments') elif ((len(rest) > 0) or (type(c) is int) or (type(c) is Integer)): c = C(([c] + list(rest))) else: c = C(list(c)) return self.monomial(c)
This method implements the abuses of notations ``p[2,1]``, ``p[[2,1]]``, ``p[Partition([2,1])]``. INPUT: - ``c`` -- a list, list of lists, or partition .. TODO:: Should call ``super.term`` so as not to interfere with the standard notation ``p['x,y,z']``. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: s[2,1] s[2, 1] sage: s[[2,1]] s[2, 1] sage: s[Partition([2,1])] s[2, 1]
src/sage/combinat/sf/sfa.py
__getitem__
bopopescu/sagesmc
5
python
def __getitem__(self, c, *rest): "\n This method implements the abuses of notations ``p[2,1]``,\n ``p[[2,1]]``, ``p[Partition([2,1])]``.\n\n INPUT:\n\n - ``c`` -- a list, list of lists, or partition\n\n .. TODO::\n\n Should call ``super.term`` so as not to interfere with the\n standard notation ``p['x,y,z']``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s[2,1]\n s[2, 1]\n sage: s[[2,1]]\n s[2, 1]\n sage: s[Partition([2,1])]\n s[2, 1]\n " C = self.basis().keys() if isinstance(c, C.element_class): if (len(rest) != 0): raise ValueError('invalid number of arguments') elif ((len(rest) > 0) or (type(c) is int) or (type(c) is Integer)): c = C(([c] + list(rest))) else: c = C(list(c)) return self.monomial(c)
def __getitem__(self, c, *rest): "\n This method implements the abuses of notations ``p[2,1]``,\n ``p[[2,1]]``, ``p[Partition([2,1])]``.\n\n INPUT:\n\n - ``c`` -- a list, list of lists, or partition\n\n .. TODO::\n\n Should call ``super.term`` so as not to interfere with the\n standard notation ``p['x,y,z']``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s[2,1]\n s[2, 1]\n sage: s[[2,1]]\n s[2, 1]\n sage: s[Partition([2,1])]\n s[2, 1]\n " C = self.basis().keys() if isinstance(c, C.element_class): if (len(rest) != 0): raise ValueError('invalid number of arguments') elif ((len(rest) > 0) or (type(c) is int) or (type(c) is Integer)): c = C(([c] + list(rest))) else: c = C(list(c)) return self.monomial(c)<|docstring|>This method implements the abuses of notations ``p[2,1]``, ``p[[2,1]]``, ``p[Partition([2,1])]``. INPUT: - ``c`` -- a list, list of lists, or partition .. TODO:: Should call ``super.term`` so as not to interfere with the standard notation ``p['x,y,z']``. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: s[2,1] s[2, 1] sage: s[[2,1]] s[2, 1] sage: s[Partition([2,1])] s[2, 1]<|endoftext|>
6948a0a518543fd3a021dab16bf8e3769405b341819ef6d142e2be5093d1a6cb
def _change_by_proportionality(self, x, function): '\n Return the symmetric function obtained from ``x`` by scaling\n each basis element corresponding to the partition `\\lambda` by\n ``function``(`\\lambda`).\n\n INPUT:\n\n - ``x`` -- a symmetric function\n - ``function`` -- a function which takes in a partition\n and returns a scalar\n\n OUTPUT:\n\n A symmetric function in ``self`` which is a scaled version of ``x``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([3])+s([2,1])+s([1,1,1]); a\n s[1, 1, 1] + s[2, 1] + s[3]\n sage: f = lambda part: len(part)\n sage: s._change_by_proportionality(a, f)\n 3*s[1, 1, 1] + 2*s[2, 1] + s[3]\n ' BR = self.base_ring() z_elt = {} for (m, c) in x._monomial_coefficients.iteritems(): coeff = function(m) z_elt[m] = BR((c * coeff)) return self._from_dict(z_elt)
Return the symmetric function obtained from ``x`` by scaling each basis element corresponding to the partition `\lambda` by ``function``(`\lambda`). INPUT: - ``x`` -- a symmetric function - ``function`` -- a function which takes in a partition and returns a scalar OUTPUT: A symmetric function in ``self`` which is a scaled version of ``x``. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: a = s([3])+s([2,1])+s([1,1,1]); a s[1, 1, 1] + s[2, 1] + s[3] sage: f = lambda part: len(part) sage: s._change_by_proportionality(a, f) 3*s[1, 1, 1] + 2*s[2, 1] + s[3]
src/sage/combinat/sf/sfa.py
_change_by_proportionality
bopopescu/sagesmc
5
python
def _change_by_proportionality(self, x, function): '\n Return the symmetric function obtained from ``x`` by scaling\n each basis element corresponding to the partition `\\lambda` by\n ``function``(`\\lambda`).\n\n INPUT:\n\n - ``x`` -- a symmetric function\n - ``function`` -- a function which takes in a partition\n and returns a scalar\n\n OUTPUT:\n\n A symmetric function in ``self`` which is a scaled version of ``x``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([3])+s([2,1])+s([1,1,1]); a\n s[1, 1, 1] + s[2, 1] + s[3]\n sage: f = lambda part: len(part)\n sage: s._change_by_proportionality(a, f)\n 3*s[1, 1, 1] + 2*s[2, 1] + s[3]\n ' BR = self.base_ring() z_elt = {} for (m, c) in x._monomial_coefficients.iteritems(): coeff = function(m) z_elt[m] = BR((c * coeff)) return self._from_dict(z_elt)
def _change_by_proportionality(self, x, function): '\n Return the symmetric function obtained from ``x`` by scaling\n each basis element corresponding to the partition `\\lambda` by\n ``function``(`\\lambda`).\n\n INPUT:\n\n - ``x`` -- a symmetric function\n - ``function`` -- a function which takes in a partition\n and returns a scalar\n\n OUTPUT:\n\n A symmetric function in ``self`` which is a scaled version of ``x``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([3])+s([2,1])+s([1,1,1]); a\n s[1, 1, 1] + s[2, 1] + s[3]\n sage: f = lambda part: len(part)\n sage: s._change_by_proportionality(a, f)\n 3*s[1, 1, 1] + 2*s[2, 1] + s[3]\n ' BR = self.base_ring() z_elt = {} for (m, c) in x._monomial_coefficients.iteritems(): coeff = function(m) z_elt[m] = BR((c * coeff)) return self._from_dict(z_elt)<|docstring|>Return the symmetric function obtained from ``x`` by scaling each basis element corresponding to the partition `\lambda` by ``function``(`\lambda`). INPUT: - ``x`` -- a symmetric function - ``function`` -- a function which takes in a partition and returns a scalar OUTPUT: A symmetric function in ``self`` which is a scaled version of ``x``. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: a = s([3])+s([2,1])+s([1,1,1]); a s[1, 1, 1] + s[2, 1] + s[3] sage: f = lambda part: len(part) sage: s._change_by_proportionality(a, f) 3*s[1, 1, 1] + 2*s[2, 1] + s[3]<|endoftext|>
ee2ad53d81c1d99cf0dab4bbb5e3db754b653f84fffbb17bbddf1c9ff812f0a5
def _change_by_plethysm(self, x, expr, deg_one): '\n Return the plethysm of ``x`` by ``expr``.\n\n INPUT:\n\n - ``x` -- a symmetric function\n - ``expr`` -- an expression used in the plethysm\n - ``deg_one`` -- a list (or iterable) specifying the degree one\n variables (that is, the terms to be treated as degree-one\n elements when encountered in ``x``; they will be taken to the\n appropriate powers when computing the plethysm)\n\n OUTPUT:\n\n The plethysm of ``x`` by ``expr``.\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: a = m([2,1])\n sage: a.omega()\n -m[2, 1] - 2*m[3]\n sage: m._change_by_plethysm(-a,-1,[])\n -m[2, 1] - 2*m[3]\n\n ::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([3])\n sage: s._change_by_plethysm(-a,-1,[])\n s[1, 1, 1]\n ' p = self.realization_of().power() p_x = p(x) expr_k = (lambda k: expr.subs(**dict([(str(x), (x ** k)) for x in deg_one]))) f = (lambda m, c: (m, (c * prod([expr_k(k) for k in m])))) return self(p_x.map_item(f))
Return the plethysm of ``x`` by ``expr``. INPUT: - ``x` -- a symmetric function - ``expr`` -- an expression used in the plethysm - ``deg_one`` -- a list (or iterable) specifying the degree one variables (that is, the terms to be treated as degree-one elements when encountered in ``x``; they will be taken to the appropriate powers when computing the plethysm) OUTPUT: The plethysm of ``x`` by ``expr``. EXAMPLES:: sage: m = SymmetricFunctions(QQ).m() sage: a = m([2,1]) sage: a.omega() -m[2, 1] - 2*m[3] sage: m._change_by_plethysm(-a,-1,[]) -m[2, 1] - 2*m[3] :: sage: s = SymmetricFunctions(QQ).s() sage: a = s([3]) sage: s._change_by_plethysm(-a,-1,[]) s[1, 1, 1]
src/sage/combinat/sf/sfa.py
_change_by_plethysm
bopopescu/sagesmc
5
python
def _change_by_plethysm(self, x, expr, deg_one): '\n Return the plethysm of ``x`` by ``expr``.\n\n INPUT:\n\n - ``x` -- a symmetric function\n - ``expr`` -- an expression used in the plethysm\n - ``deg_one`` -- a list (or iterable) specifying the degree one\n variables (that is, the terms to be treated as degree-one\n elements when encountered in ``x``; they will be taken to the\n appropriate powers when computing the plethysm)\n\n OUTPUT:\n\n The plethysm of ``x`` by ``expr``.\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: a = m([2,1])\n sage: a.omega()\n -m[2, 1] - 2*m[3]\n sage: m._change_by_plethysm(-a,-1,[])\n -m[2, 1] - 2*m[3]\n\n ::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([3])\n sage: s._change_by_plethysm(-a,-1,[])\n s[1, 1, 1]\n ' p = self.realization_of().power() p_x = p(x) expr_k = (lambda k: expr.subs(**dict([(str(x), (x ** k)) for x in deg_one]))) f = (lambda m, c: (m, (c * prod([expr_k(k) for k in m])))) return self(p_x.map_item(f))
def _change_by_plethysm(self, x, expr, deg_one): '\n Return the plethysm of ``x`` by ``expr``.\n\n INPUT:\n\n - ``x` -- a symmetric function\n - ``expr`` -- an expression used in the plethysm\n - ``deg_one`` -- a list (or iterable) specifying the degree one\n variables (that is, the terms to be treated as degree-one\n elements when encountered in ``x``; they will be taken to the\n appropriate powers when computing the plethysm)\n\n OUTPUT:\n\n The plethysm of ``x`` by ``expr``.\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: a = m([2,1])\n sage: a.omega()\n -m[2, 1] - 2*m[3]\n sage: m._change_by_plethysm(-a,-1,[])\n -m[2, 1] - 2*m[3]\n\n ::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([3])\n sage: s._change_by_plethysm(-a,-1,[])\n s[1, 1, 1]\n ' p = self.realization_of().power() p_x = p(x) expr_k = (lambda k: expr.subs(**dict([(str(x), (x ** k)) for x in deg_one]))) f = (lambda m, c: (m, (c * prod([expr_k(k) for k in m])))) return self(p_x.map_item(f))<|docstring|>Return the plethysm of ``x`` by ``expr``. INPUT: - ``x` -- a symmetric function - ``expr`` -- an expression used in the plethysm - ``deg_one`` -- a list (or iterable) specifying the degree one variables (that is, the terms to be treated as degree-one elements when encountered in ``x``; they will be taken to the appropriate powers when computing the plethysm) OUTPUT: The plethysm of ``x`` by ``expr``. EXAMPLES:: sage: m = SymmetricFunctions(QQ).m() sage: a = m([2,1]) sage: a.omega() -m[2, 1] - 2*m[3] sage: m._change_by_plethysm(-a,-1,[]) -m[2, 1] - 2*m[3] :: sage: s = SymmetricFunctions(QQ).s() sage: a = s([3]) sage: s._change_by_plethysm(-a,-1,[]) s[1, 1, 1]<|endoftext|>
fdedded23af43049121ea168f04d135632824b62af3e7ba6e2e8e3b9f5564e66
def _apply_multi_module_morphism(self, x, y, f, orthogonal=False): '\n Applies morphism specified by ``f`` on (``x``,``y``).\n\n INPUT:\n\n - ``x`` -- an element of ``self``\n - ``y`` -- an element of ``self``\n - ``f`` -- a function that takes in two partitions\n (basis elements) and returns an element of the target domain\n - ``orthogonal`` -- if orthogonal is set to ``True``, then\n ``f(part1, part2)`` is assumed to be 0 if ``part1 != part2``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([2,1])+s([1,1,1])\n sage: b = s([3])+s([2,1])\n sage: f1 = lambda p1, p2: len(p1)*len(p2)\n sage: f2 = lambda p1, p2: len(p1)+len(p2)\n sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=False) #(2+3)*(2+1)\n 15\n sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=True) #(2)*(2)\n 4\n sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=False) #2*(2+3+2+1)\n 16\n sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=True) #2+2\n 4\n ' res = 0 if orthogonal: for (mx, cx) in x._monomial_coefficients.iteritems(): if (mx not in y._monomial_coefficients): continue else: cy = y._monomial_coefficients[mx] res += ((cx * cy) * f(mx, mx)) return res else: for (mx, cx) in x._monomial_coefficients.iteritems(): for (my, cy) in y._monomial_coefficients.iteritems(): res += ((cx * cy) * f(mx, my)) return res
Applies morphism specified by ``f`` on (``x``,``y``). INPUT: - ``x`` -- an element of ``self`` - ``y`` -- an element of ``self`` - ``f`` -- a function that takes in two partitions (basis elements) and returns an element of the target domain - ``orthogonal`` -- if orthogonal is set to ``True``, then ``f(part1, part2)`` is assumed to be 0 if ``part1 != part2``. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: a = s([2,1])+s([1,1,1]) sage: b = s([3])+s([2,1]) sage: f1 = lambda p1, p2: len(p1)*len(p2) sage: f2 = lambda p1, p2: len(p1)+len(p2) sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=False) #(2+3)*(2+1) 15 sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=True) #(2)*(2) 4 sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=False) #2*(2+3+2+1) 16 sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=True) #2+2 4
src/sage/combinat/sf/sfa.py
_apply_multi_module_morphism
bopopescu/sagesmc
5
python
def _apply_multi_module_morphism(self, x, y, f, orthogonal=False): '\n Applies morphism specified by ``f`` on (``x``,``y``).\n\n INPUT:\n\n - ``x`` -- an element of ``self``\n - ``y`` -- an element of ``self``\n - ``f`` -- a function that takes in two partitions\n (basis elements) and returns an element of the target domain\n - ``orthogonal`` -- if orthogonal is set to ``True``, then\n ``f(part1, part2)`` is assumed to be 0 if ``part1 != part2``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([2,1])+s([1,1,1])\n sage: b = s([3])+s([2,1])\n sage: f1 = lambda p1, p2: len(p1)*len(p2)\n sage: f2 = lambda p1, p2: len(p1)+len(p2)\n sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=False) #(2+3)*(2+1)\n 15\n sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=True) #(2)*(2)\n 4\n sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=False) #2*(2+3+2+1)\n 16\n sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=True) #2+2\n 4\n ' res = 0 if orthogonal: for (mx, cx) in x._monomial_coefficients.iteritems(): if (mx not in y._monomial_coefficients): continue else: cy = y._monomial_coefficients[mx] res += ((cx * cy) * f(mx, mx)) return res else: for (mx, cx) in x._monomial_coefficients.iteritems(): for (my, cy) in y._monomial_coefficients.iteritems(): res += ((cx * cy) * f(mx, my)) return res
def _apply_multi_module_morphism(self, x, y, f, orthogonal=False): '\n Applies morphism specified by ``f`` on (``x``,``y``).\n\n INPUT:\n\n - ``x`` -- an element of ``self``\n - ``y`` -- an element of ``self``\n - ``f`` -- a function that takes in two partitions\n (basis elements) and returns an element of the target domain\n - ``orthogonal`` -- if orthogonal is set to ``True``, then\n ``f(part1, part2)`` is assumed to be 0 if ``part1 != part2``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([2,1])+s([1,1,1])\n sage: b = s([3])+s([2,1])\n sage: f1 = lambda p1, p2: len(p1)*len(p2)\n sage: f2 = lambda p1, p2: len(p1)+len(p2)\n sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=False) #(2+3)*(2+1)\n 15\n sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=True) #(2)*(2)\n 4\n sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=False) #2*(2+3+2+1)\n 16\n sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=True) #2+2\n 4\n ' res = 0 if orthogonal: for (mx, cx) in x._monomial_coefficients.iteritems(): if (mx not in y._monomial_coefficients): continue else: cy = y._monomial_coefficients[mx] res += ((cx * cy) * f(mx, mx)) return res else: for (mx, cx) in x._monomial_coefficients.iteritems(): for (my, cy) in y._monomial_coefficients.iteritems(): res += ((cx * cy) * f(mx, my)) return res<|docstring|>Applies morphism specified by ``f`` on (``x``,``y``). INPUT: - ``x`` -- an element of ``self`` - ``y`` -- an element of ``self`` - ``f`` -- a function that takes in two partitions (basis elements) and returns an element of the target domain - ``orthogonal`` -- if orthogonal is set to ``True``, then ``f(part1, part2)`` is assumed to be 0 if ``part1 != part2``. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: a = s([2,1])+s([1,1,1]) sage: b = s([3])+s([2,1]) sage: f1 = lambda p1, p2: len(p1)*len(p2) sage: f2 = lambda p1, p2: len(p1)+len(p2) sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=False) #(2+3)*(2+1) 15 sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=True) #(2)*(2) 4 sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=False) #2*(2+3+2+1) 16 sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=True) #2+2 4<|endoftext|>
a617703b0ddf560fd5131add55080878f9d556c7c79add943cb2e902194105a8
def _from_element(self, x): "\n Return the element of ``self`` with the same 'internal structure' as\n ``x``. This means the element whose coefficients in the basis ``self``\n are the respective coefficients of ``x`` in the basis of ``x``.\n\n INPUT:\n\n - ``x`` -- a symmetric function\n\n EXAMPLES::\n\n sage: e = SymmetricFunctions(QQ).e()\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = e([2,1]) + e([1,1,1]); a\n e[1, 1, 1] + e[2, 1]\n sage: s._from_element(a)\n s[1, 1, 1] + s[2, 1]\n " return self._from_dict(x.monomial_coefficients())
Return the element of ``self`` with the same 'internal structure' as ``x``. This means the element whose coefficients in the basis ``self`` are the respective coefficients of ``x`` in the basis of ``x``. INPUT: - ``x`` -- a symmetric function EXAMPLES:: sage: e = SymmetricFunctions(QQ).e() sage: s = SymmetricFunctions(QQ).s() sage: a = e([2,1]) + e([1,1,1]); a e[1, 1, 1] + e[2, 1] sage: s._from_element(a) s[1, 1, 1] + s[2, 1]
src/sage/combinat/sf/sfa.py
_from_element
bopopescu/sagesmc
5
python
def _from_element(self, x): "\n Return the element of ``self`` with the same 'internal structure' as\n ``x``. This means the element whose coefficients in the basis ``self``\n are the respective coefficients of ``x`` in the basis of ``x``.\n\n INPUT:\n\n - ``x`` -- a symmetric function\n\n EXAMPLES::\n\n sage: e = SymmetricFunctions(QQ).e()\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = e([2,1]) + e([1,1,1]); a\n e[1, 1, 1] + e[2, 1]\n sage: s._from_element(a)\n s[1, 1, 1] + s[2, 1]\n " return self._from_dict(x.monomial_coefficients())
def _from_element(self, x): "\n Return the element of ``self`` with the same 'internal structure' as\n ``x``. This means the element whose coefficients in the basis ``self``\n are the respective coefficients of ``x`` in the basis of ``x``.\n\n INPUT:\n\n - ``x`` -- a symmetric function\n\n EXAMPLES::\n\n sage: e = SymmetricFunctions(QQ).e()\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = e([2,1]) + e([1,1,1]); a\n e[1, 1, 1] + e[2, 1]\n sage: s._from_element(a)\n s[1, 1, 1] + s[2, 1]\n " return self._from_dict(x.monomial_coefficients())<|docstring|>Return the element of ``self`` with the same 'internal structure' as ``x``. This means the element whose coefficients in the basis ``self`` are the respective coefficients of ``x`` in the basis of ``x``. INPUT: - ``x`` -- a symmetric function EXAMPLES:: sage: e = SymmetricFunctions(QQ).e() sage: s = SymmetricFunctions(QQ).s() sage: a = e([2,1]) + e([1,1,1]); a e[1, 1, 1] + e[2, 1] sage: s._from_element(a) s[1, 1, 1] + s[2, 1]<|endoftext|>
3d12551bf7937fe717b80d690485e696b0156342b8b03860961db8854fed2778
def _from_cache(self, element, cache_function, cache_dict, **subs_dict): '\n Return the image of an element ``element`` of some realization `M`\n of the ring of symmetric functions under a linear map from `M` to\n ``self`` whose matrix representation is cached (with ``cache_dict``\n serving as cache, and ``cache_function`` as the function which\n precomputes this cache).\n\n INPUT:\n\n - ``element`` -- an element of a realization `M` of the ring of\n symmetric functions. Note that `M` can be a different realization\n than the one in which ``self`` is written, and does not have to\n be specified. It is assumed that the basis of ``self`` is indexed\n by partitions, and the degree of a basis element is the size of\n the partition indexing it.\n\n - ``cache_function`` -- a function which accepts an\n integer `n` as its input and creates the cache for that homogeneous\n component (saving it in ``cache_dict``).\n\n - ``cache_dict`` -- a dictionary storing a cache.\n It should be indexed by the positive integers `n`. Its values\n are dictionaries indexed by the partitions of size `n`. The values\n of those latter dictionaries are, again, dictionaries indexed by\n partitions of size `n`. Altogether, ``cache_dict`` should be\n understood to encode a graded linear map from `M` to the\n realization ``self`` of the ring of symmetric functions; the\n encoding is done in such a way that, for any `n` and any partitions\n ``lam`` and ``mu`` of `n`, the ``self[mu]``-coordinate of the image\n of ``M[lam]`` under this linear map (in the basis ``self``) is\n ``cache_dict[lam][mu]``.\n\n - ``subs_dict`` -- (optional) a dictionary for any substitutions\n to make after the value is extracted from ``cache_dict``.\n\n EXAMPLES::\n\n sage: R.<x> = QQ[]\n sage: Sym = SymmetricFunctions(R)\n sage: s = Sym.s()\n sage: p21 = Partition([2,1])\n sage: a = s(p21)\n sage: e = Sym.e()\n sage: cache_dict = {}\n sage: cache_dict[3] = {}\n sage: cache_dict[3][p21] = {}\n sage: cache_dict[3][p21][p21] = x^2\n sage: cache_dict[3][p21][Partition([1,1,1])] = 3*x\n sage: cache_function = lambda n: 0 #do nothing\n sage: e._from_cache(a, cache_function, cache_dict)\n 3*x*e[1, 1, 1] + x^2*e[2, 1]\n sage: e._from_cache(a, cache_function, cache_dict, x=2)\n 6*e[1, 1, 1] + 4*e[2, 1]\n ' BR = self.base_ring() zero = BR.zero() z_elt = {} for (part, c) in element.monomial_coefficients().iteritems(): if (sum(part) not in cache_dict): cache_function(sum(part)) part = _Partitions(part) for (part2, c2) in cache_dict[sum(part)][part].iteritems(): if hasattr(c2, 'subs'): c3 = (c * BR(c2.subs(**subs_dict))) else: c3 = (c * BR(c2)) z_elt[part2] = (z_elt.get(part2, zero) + BR(c3)) return self._from_dict(z_elt)
Return the image of an element ``element`` of some realization `M` of the ring of symmetric functions under a linear map from `M` to ``self`` whose matrix representation is cached (with ``cache_dict`` serving as cache, and ``cache_function`` as the function which precomputes this cache). INPUT: - ``element`` -- an element of a realization `M` of the ring of symmetric functions. Note that `M` can be a different realization than the one in which ``self`` is written, and does not have to be specified. It is assumed that the basis of ``self`` is indexed by partitions, and the degree of a basis element is the size of the partition indexing it. - ``cache_function`` -- a function which accepts an integer `n` as its input and creates the cache for that homogeneous component (saving it in ``cache_dict``). - ``cache_dict`` -- a dictionary storing a cache. It should be indexed by the positive integers `n`. Its values are dictionaries indexed by the partitions of size `n`. The values of those latter dictionaries are, again, dictionaries indexed by partitions of size `n`. Altogether, ``cache_dict`` should be understood to encode a graded linear map from `M` to the realization ``self`` of the ring of symmetric functions; the encoding is done in such a way that, for any `n` and any partitions ``lam`` and ``mu`` of `n`, the ``self[mu]``-coordinate of the image of ``M[lam]`` under this linear map (in the basis ``self``) is ``cache_dict[lam][mu]``. - ``subs_dict`` -- (optional) a dictionary for any substitutions to make after the value is extracted from ``cache_dict``. EXAMPLES:: sage: R.<x> = QQ[] sage: Sym = SymmetricFunctions(R) sage: s = Sym.s() sage: p21 = Partition([2,1]) sage: a = s(p21) sage: e = Sym.e() sage: cache_dict = {} sage: cache_dict[3] = {} sage: cache_dict[3][p21] = {} sage: cache_dict[3][p21][p21] = x^2 sage: cache_dict[3][p21][Partition([1,1,1])] = 3*x sage: cache_function = lambda n: 0 #do nothing sage: e._from_cache(a, cache_function, cache_dict) 3*x*e[1, 1, 1] + x^2*e[2, 1] sage: e._from_cache(a, cache_function, cache_dict, x=2) 6*e[1, 1, 1] + 4*e[2, 1]
src/sage/combinat/sf/sfa.py
_from_cache
bopopescu/sagesmc
5
python
def _from_cache(self, element, cache_function, cache_dict, **subs_dict): '\n Return the image of an element ``element`` of some realization `M`\n of the ring of symmetric functions under a linear map from `M` to\n ``self`` whose matrix representation is cached (with ``cache_dict``\n serving as cache, and ``cache_function`` as the function which\n precomputes this cache).\n\n INPUT:\n\n - ``element`` -- an element of a realization `M` of the ring of\n symmetric functions. Note that `M` can be a different realization\n than the one in which ``self`` is written, and does not have to\n be specified. It is assumed that the basis of ``self`` is indexed\n by partitions, and the degree of a basis element is the size of\n the partition indexing it.\n\n - ``cache_function`` -- a function which accepts an\n integer `n` as its input and creates the cache for that homogeneous\n component (saving it in ``cache_dict``).\n\n - ``cache_dict`` -- a dictionary storing a cache.\n It should be indexed by the positive integers `n`. Its values\n are dictionaries indexed by the partitions of size `n`. The values\n of those latter dictionaries are, again, dictionaries indexed by\n partitions of size `n`. Altogether, ``cache_dict`` should be\n understood to encode a graded linear map from `M` to the\n realization ``self`` of the ring of symmetric functions; the\n encoding is done in such a way that, for any `n` and any partitions\n ``lam`` and ``mu`` of `n`, the ``self[mu]``-coordinate of the image\n of ``M[lam]`` under this linear map (in the basis ``self``) is\n ``cache_dict[lam][mu]``.\n\n - ``subs_dict`` -- (optional) a dictionary for any substitutions\n to make after the value is extracted from ``cache_dict``.\n\n EXAMPLES::\n\n sage: R.<x> = QQ[]\n sage: Sym = SymmetricFunctions(R)\n sage: s = Sym.s()\n sage: p21 = Partition([2,1])\n sage: a = s(p21)\n sage: e = Sym.e()\n sage: cache_dict = {}\n sage: cache_dict[3] = {}\n sage: cache_dict[3][p21] = {}\n sage: cache_dict[3][p21][p21] = x^2\n sage: cache_dict[3][p21][Partition([1,1,1])] = 3*x\n sage: cache_function = lambda n: 0 #do nothing\n sage: e._from_cache(a, cache_function, cache_dict)\n 3*x*e[1, 1, 1] + x^2*e[2, 1]\n sage: e._from_cache(a, cache_function, cache_dict, x=2)\n 6*e[1, 1, 1] + 4*e[2, 1]\n ' BR = self.base_ring() zero = BR.zero() z_elt = {} for (part, c) in element.monomial_coefficients().iteritems(): if (sum(part) not in cache_dict): cache_function(sum(part)) part = _Partitions(part) for (part2, c2) in cache_dict[sum(part)][part].iteritems(): if hasattr(c2, 'subs'): c3 = (c * BR(c2.subs(**subs_dict))) else: c3 = (c * BR(c2)) z_elt[part2] = (z_elt.get(part2, zero) + BR(c3)) return self._from_dict(z_elt)
def _from_cache(self, element, cache_function, cache_dict, **subs_dict): '\n Return the image of an element ``element`` of some realization `M`\n of the ring of symmetric functions under a linear map from `M` to\n ``self`` whose matrix representation is cached (with ``cache_dict``\n serving as cache, and ``cache_function`` as the function which\n precomputes this cache).\n\n INPUT:\n\n - ``element`` -- an element of a realization `M` of the ring of\n symmetric functions. Note that `M` can be a different realization\n than the one in which ``self`` is written, and does not have to\n be specified. It is assumed that the basis of ``self`` is indexed\n by partitions, and the degree of a basis element is the size of\n the partition indexing it.\n\n - ``cache_function`` -- a function which accepts an\n integer `n` as its input and creates the cache for that homogeneous\n component (saving it in ``cache_dict``).\n\n - ``cache_dict`` -- a dictionary storing a cache.\n It should be indexed by the positive integers `n`. Its values\n are dictionaries indexed by the partitions of size `n`. The values\n of those latter dictionaries are, again, dictionaries indexed by\n partitions of size `n`. Altogether, ``cache_dict`` should be\n understood to encode a graded linear map from `M` to the\n realization ``self`` of the ring of symmetric functions; the\n encoding is done in such a way that, for any `n` and any partitions\n ``lam`` and ``mu`` of `n`, the ``self[mu]``-coordinate of the image\n of ``M[lam]`` under this linear map (in the basis ``self``) is\n ``cache_dict[lam][mu]``.\n\n - ``subs_dict`` -- (optional) a dictionary for any substitutions\n to make after the value is extracted from ``cache_dict``.\n\n EXAMPLES::\n\n sage: R.<x> = QQ[]\n sage: Sym = SymmetricFunctions(R)\n sage: s = Sym.s()\n sage: p21 = Partition([2,1])\n sage: a = s(p21)\n sage: e = Sym.e()\n sage: cache_dict = {}\n sage: cache_dict[3] = {}\n sage: cache_dict[3][p21] = {}\n sage: cache_dict[3][p21][p21] = x^2\n sage: cache_dict[3][p21][Partition([1,1,1])] = 3*x\n sage: cache_function = lambda n: 0 #do nothing\n sage: e._from_cache(a, cache_function, cache_dict)\n 3*x*e[1, 1, 1] + x^2*e[2, 1]\n sage: e._from_cache(a, cache_function, cache_dict, x=2)\n 6*e[1, 1, 1] + 4*e[2, 1]\n ' BR = self.base_ring() zero = BR.zero() z_elt = {} for (part, c) in element.monomial_coefficients().iteritems(): if (sum(part) not in cache_dict): cache_function(sum(part)) part = _Partitions(part) for (part2, c2) in cache_dict[sum(part)][part].iteritems(): if hasattr(c2, 'subs'): c3 = (c * BR(c2.subs(**subs_dict))) else: c3 = (c * BR(c2)) z_elt[part2] = (z_elt.get(part2, zero) + BR(c3)) return self._from_dict(z_elt)<|docstring|>Return the image of an element ``element`` of some realization `M` of the ring of symmetric functions under a linear map from `M` to ``self`` whose matrix representation is cached (with ``cache_dict`` serving as cache, and ``cache_function`` as the function which precomputes this cache). INPUT: - ``element`` -- an element of a realization `M` of the ring of symmetric functions. Note that `M` can be a different realization than the one in which ``self`` is written, and does not have to be specified. It is assumed that the basis of ``self`` is indexed by partitions, and the degree of a basis element is the size of the partition indexing it. - ``cache_function`` -- a function which accepts an integer `n` as its input and creates the cache for that homogeneous component (saving it in ``cache_dict``). - ``cache_dict`` -- a dictionary storing a cache. It should be indexed by the positive integers `n`. Its values are dictionaries indexed by the partitions of size `n`. The values of those latter dictionaries are, again, dictionaries indexed by partitions of size `n`. Altogether, ``cache_dict`` should be understood to encode a graded linear map from `M` to the realization ``self`` of the ring of symmetric functions; the encoding is done in such a way that, for any `n` and any partitions ``lam`` and ``mu`` of `n`, the ``self[mu]``-coordinate of the image of ``M[lam]`` under this linear map (in the basis ``self``) is ``cache_dict[lam][mu]``. - ``subs_dict`` -- (optional) a dictionary for any substitutions to make after the value is extracted from ``cache_dict``. EXAMPLES:: sage: R.<x> = QQ[] sage: Sym = SymmetricFunctions(R) sage: s = Sym.s() sage: p21 = Partition([2,1]) sage: a = s(p21) sage: e = Sym.e() sage: cache_dict = {} sage: cache_dict[3] = {} sage: cache_dict[3][p21] = {} sage: cache_dict[3][p21][p21] = x^2 sage: cache_dict[3][p21][Partition([1,1,1])] = 3*x sage: cache_function = lambda n: 0 #do nothing sage: e._from_cache(a, cache_function, cache_dict) 3*x*e[1, 1, 1] + x^2*e[2, 1] sage: e._from_cache(a, cache_function, cache_dict, x=2) 6*e[1, 1, 1] + 4*e[2, 1]<|endoftext|>
d703ff42f57b12651b0b16b352d161d63786e416398f5d1f04a2841f0749db4a
def _invert_morphism(self, n, base_ring, self_to_other_cache, other_to_self_cache, to_other_function=None, to_self_function=None, upper_triangular=False, lower_triangular=False, ones_on_diagonal=False): "\n Compute the inverse of a morphism between ``self`` and ``other``\n (more precisely, its `n`-th graded component).\n\n In order to use this, you must be able to compute the morphism in\n one direction. This method assumes that the morphism is indeed\n invertible.\n\n INPUT:\n\n - ``n`` -- an integer, the homogeneous component of\n symmetric functions for which we want to a morphism's inverse\n\n - ``base_ring`` -- the base ring being worked over\n\n - ``self_to_other_cache`` -- a dictionary which\n stores the transition from ``self`` to ``other``\n\n - ``other_to_self_cache`` -- a dictionary which\n stores the transition from ``other`` to ``self``\n\n - ``to_other_function`` -- a function which takes in\n a partition and returns a function which gives the coefficients of\n ``self(part)`` in the ``other`` basis\n\n - ``to_self_function`` -- a function which takes in a\n partition and returns a function which gives the coefficients of\n ``other(part)`` in ``self``\n\n - ``upper_triangular`` -- a boolean, if ``True``, the\n inverse will be computed by back substitution\n\n - ``lower_triangular`` -- a boolean, if ``True``, the\n inverse will be computed by forward substitution\n\n - ``ones_on_diagonal`` -- a boolean, if ``True``, the\n entries on the diagonal of the morphism (and inverse) matrix are\n assumed to be ones. This is used to remove divisions from the\n forward and back substitute algorithms.\n\n OUTPUT:\n\n Nothing is returned, but the caches ``self_to_other_cache``\n and ``other_to_self_cache`` are updated with the `n`-th degree\n components of the respective transition matrices.\n\n EXAMPLES:\n\n First, we will do an example of inverting the morphism\n which sends a Schur function to its conjugate Schur function. Note\n that this is an involution. ::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: conj = lambda p1: lambda p2: QQ(1) if p2 == p1.conjugate() else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(4, QQ, c1, c2, to_other_function = conj)\n sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]\n sage: l(c1[4])\n [([1, 1, 1, 1], [([4], 1)]),\n ([2, 1, 1], [([3, 1], 1)]),\n ([2, 2], [([2, 2], 1)]),\n ([3, 1], [([2, 1, 1], 1)]),\n ([4], [([1, 1, 1, 1], 1)])]\n sage: l(c2[4])\n [([1, 1, 1, 1], [([4], 1)]),\n ([2, 1, 1], [([3, 1], 1)]),\n ([2, 2], [([2, 2], 1)]),\n ([3, 1], [([2, 1, 1], 1)]),\n ([4], [([1, 1, 1, 1], 1)])]\n sage: c2 == c1\n True\n\n We can check that we get the same results if we specify\n ``to_self_function = conj``::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(4, QQ, d1, d2, to_self_function = conj)\n sage: d1 == c1\n True\n sage: d2 == c2\n True\n\n Now we do an example of upper triangularity and check that we get\n the same thing whether or not we specify ``ones_on_diagonal``::\n\n sage: f = lambda p1: lambda p2: QQ(1) if p2 <= p1 else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, upper_triangular=True)\n sage: l(c1[3])\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], 1), ([2, 1], 1)]),\n ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]\n sage: l(c2[3])\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], -1), ([2, 1], 1)]),\n ([3], [([2, 1], -1), ([3], 1)])]\n\n ::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,upper_triangular=True, ones_on_diagonal=True)\n sage: c1 == d1\n True\n sage: c2 == d2\n True\n\n Finally, we do the same thing for lower triangular matrices::\n\n sage: f = lambda p1: lambda p2: QQ(1) if p2 >= p1 else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, lower_triangular=True)\n sage: l(c1[3])\n [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)]),\n ([2, 1], [([2, 1], 1), ([3], 1)]),\n ([3], [([3], 1)])]\n\n ::\n\n sage: l(c2[3])\n [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -1)]),\n ([2, 1], [([2, 1], 1), ([3], -1)]),\n ([3], [([3], 1)])]\n\n ::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,lower_triangular=True, ones_on_diagonal=True)\n sage: c1 == d1\n True\n sage: c2 == d2\n True\n " if (to_other_function is not None): known_cache = self_to_other_cache unknown_cache = other_to_self_cache known_function = to_other_function else: unknown_cache = self_to_other_cache known_cache = other_to_self_cache known_function = to_self_function if ((n in known_cache) and (n in unknown_cache)): return one = base_ring.one() zero = base_ring.zero() pn = sage.combinat.partition.Partitions_n(n).list() len_pn = len(pn) known_cache_n = {} known_matrix_n = matrix(base_ring, len_pn, len_pn) unknown_cache_n = {} for i in range(len_pn): known_cache_part = {} f = known_function(pn[i]) for j in range(len_pn): if (lower_triangular and (j > i)): break if (upper_triangular and (i > j)): continue value = f(pn[j]) if (value != zero): known_cache_part[pn[j]] = value known_matrix_n[(i, j)] = value known_cache_n[pn[i]] = known_cache_part unknown_cache_n[pn[i]] = {} if ((upper_triangular is not False) and (lower_triangular is not False)): raise ValueError('only one of upper_triangular and lower_triangular can be specified') elif (upper_triangular is not False): inverse = copy(known_matrix_n.parent().zero_matrix()) delta = (lambda i: (lambda j: (one if (i == j) else zero))) for column in range(len_pn): e = delta(column) x = ([0] * len_pn) for i in range((len_pn - 1), (- 1), (- 1)): value = e(i) if (not ones_on_diagonal): value /= known_matrix_n[(i, i)] for j in range((i + 1), len_pn): if ones_on_diagonal: value -= (known_matrix_n[(i, j)] * x[j]) else: value -= ((known_matrix_n[(i, j)] * x[j]) / known_matrix_n[(i, i)]) x[i] = value for j in range((column + 1)): if (x[j] != zero): inverse[(j, column)] = x[j] elif (lower_triangular is not False): inverse = copy(known_matrix_n.parent().zero_matrix()) delta = (lambda i: (lambda j: (one if (i == j) else zero))) for column in range(len_pn): e = delta(column) x = [] for i in range(len_pn): value = e(i) if (not ones_on_diagonal): value /= known_matrix_n[(i, i)] for j in range(len(x)): if ones_on_diagonal: value -= (known_matrix_n[(i, j)] * x[j]) else: value -= ((known_matrix_n[(i, j)] * x[j]) / known_matrix_n[(i, i)]) x.append(value) for j in range(column, len(x)): if (x[j] != zero): inverse[(j, column)] = x[j] else: inverse = (~ known_matrix_n) for i in range(len_pn): for j in range(len_pn): if (inverse[(i, j)] != zero): if hasattr(self, '_normalize_coefficients'): unknown_cache_n[pn[i]][pn[j]] = self._normalize_coefficients(inverse[(i, j)]) else: unknown_cache_n[pn[i]][pn[j]] = inverse[(i, j)] known_cache[n] = known_cache_n unknown_cache[n] = unknown_cache_n
Compute the inverse of a morphism between ``self`` and ``other`` (more precisely, its `n`-th graded component). In order to use this, you must be able to compute the morphism in one direction. This method assumes that the morphism is indeed invertible. INPUT: - ``n`` -- an integer, the homogeneous component of symmetric functions for which we want to a morphism's inverse - ``base_ring`` -- the base ring being worked over - ``self_to_other_cache`` -- a dictionary which stores the transition from ``self`` to ``other`` - ``other_to_self_cache`` -- a dictionary which stores the transition from ``other`` to ``self`` - ``to_other_function`` -- a function which takes in a partition and returns a function which gives the coefficients of ``self(part)`` in the ``other`` basis - ``to_self_function`` -- a function which takes in a partition and returns a function which gives the coefficients of ``other(part)`` in ``self`` - ``upper_triangular`` -- a boolean, if ``True``, the inverse will be computed by back substitution - ``lower_triangular`` -- a boolean, if ``True``, the inverse will be computed by forward substitution - ``ones_on_diagonal`` -- a boolean, if ``True``, the entries on the diagonal of the morphism (and inverse) matrix are assumed to be ones. This is used to remove divisions from the forward and back substitute algorithms. OUTPUT: Nothing is returned, but the caches ``self_to_other_cache`` and ``other_to_self_cache`` are updated with the `n`-th degree components of the respective transition matrices. EXAMPLES: First, we will do an example of inverting the morphism which sends a Schur function to its conjugate Schur function. Note that this is an involution. :: sage: s = SymmetricFunctions(QQ).s() sage: conj = lambda p1: lambda p2: QQ(1) if p2 == p1.conjugate() else QQ(0) sage: c1 = {} sage: c2 = {} sage: s._invert_morphism(4, QQ, c1, c2, to_other_function = conj) sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())] sage: l(c1[4]) [([1, 1, 1, 1], [([4], 1)]), ([2, 1, 1], [([3, 1], 1)]), ([2, 2], [([2, 2], 1)]), ([3, 1], [([2, 1, 1], 1)]), ([4], [([1, 1, 1, 1], 1)])] sage: l(c2[4]) [([1, 1, 1, 1], [([4], 1)]), ([2, 1, 1], [([3, 1], 1)]), ([2, 2], [([2, 2], 1)]), ([3, 1], [([2, 1, 1], 1)]), ([4], [([1, 1, 1, 1], 1)])] sage: c2 == c1 True We can check that we get the same results if we specify ``to_self_function = conj``:: sage: d1 = {} sage: d2 = {} sage: s._invert_morphism(4, QQ, d1, d2, to_self_function = conj) sage: d1 == c1 True sage: d2 == c2 True Now we do an example of upper triangularity and check that we get the same thing whether or not we specify ``ones_on_diagonal``:: sage: f = lambda p1: lambda p2: QQ(1) if p2 <= p1 else QQ(0) sage: c1 = {} sage: c2 = {} sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, upper_triangular=True) sage: l(c1[3]) [([1, 1, 1], [([1, 1, 1], 1)]), ([2, 1], [([1, 1, 1], 1), ([2, 1], 1)]), ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])] sage: l(c2[3]) [([1, 1, 1], [([1, 1, 1], 1)]), ([2, 1], [([1, 1, 1], -1), ([2, 1], 1)]), ([3], [([2, 1], -1), ([3], 1)])] :: sage: d1 = {} sage: d2 = {} sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,upper_triangular=True, ones_on_diagonal=True) sage: c1 == d1 True sage: c2 == d2 True Finally, we do the same thing for lower triangular matrices:: sage: f = lambda p1: lambda p2: QQ(1) if p2 >= p1 else QQ(0) sage: c1 = {} sage: c2 = {} sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, lower_triangular=True) sage: l(c1[3]) [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)]), ([2, 1], [([2, 1], 1), ([3], 1)]), ([3], [([3], 1)])] :: sage: l(c2[3]) [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -1)]), ([2, 1], [([2, 1], 1), ([3], -1)]), ([3], [([3], 1)])] :: sage: d1 = {} sage: d2 = {} sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,lower_triangular=True, ones_on_diagonal=True) sage: c1 == d1 True sage: c2 == d2 True
src/sage/combinat/sf/sfa.py
_invert_morphism
bopopescu/sagesmc
5
python
def _invert_morphism(self, n, base_ring, self_to_other_cache, other_to_self_cache, to_other_function=None, to_self_function=None, upper_triangular=False, lower_triangular=False, ones_on_diagonal=False): "\n Compute the inverse of a morphism between ``self`` and ``other``\n (more precisely, its `n`-th graded component).\n\n In order to use this, you must be able to compute the morphism in\n one direction. This method assumes that the morphism is indeed\n invertible.\n\n INPUT:\n\n - ``n`` -- an integer, the homogeneous component of\n symmetric functions for which we want to a morphism's inverse\n\n - ``base_ring`` -- the base ring being worked over\n\n - ``self_to_other_cache`` -- a dictionary which\n stores the transition from ``self`` to ``other``\n\n - ``other_to_self_cache`` -- a dictionary which\n stores the transition from ``other`` to ``self``\n\n - ``to_other_function`` -- a function which takes in\n a partition and returns a function which gives the coefficients of\n ``self(part)`` in the ``other`` basis\n\n - ``to_self_function`` -- a function which takes in a\n partition and returns a function which gives the coefficients of\n ``other(part)`` in ``self``\n\n - ``upper_triangular`` -- a boolean, if ``True``, the\n inverse will be computed by back substitution\n\n - ``lower_triangular`` -- a boolean, if ``True``, the\n inverse will be computed by forward substitution\n\n - ``ones_on_diagonal`` -- a boolean, if ``True``, the\n entries on the diagonal of the morphism (and inverse) matrix are\n assumed to be ones. This is used to remove divisions from the\n forward and back substitute algorithms.\n\n OUTPUT:\n\n Nothing is returned, but the caches ``self_to_other_cache``\n and ``other_to_self_cache`` are updated with the `n`-th degree\n components of the respective transition matrices.\n\n EXAMPLES:\n\n First, we will do an example of inverting the morphism\n which sends a Schur function to its conjugate Schur function. Note\n that this is an involution. ::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: conj = lambda p1: lambda p2: QQ(1) if p2 == p1.conjugate() else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(4, QQ, c1, c2, to_other_function = conj)\n sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]\n sage: l(c1[4])\n [([1, 1, 1, 1], [([4], 1)]),\n ([2, 1, 1], [([3, 1], 1)]),\n ([2, 2], [([2, 2], 1)]),\n ([3, 1], [([2, 1, 1], 1)]),\n ([4], [([1, 1, 1, 1], 1)])]\n sage: l(c2[4])\n [([1, 1, 1, 1], [([4], 1)]),\n ([2, 1, 1], [([3, 1], 1)]),\n ([2, 2], [([2, 2], 1)]),\n ([3, 1], [([2, 1, 1], 1)]),\n ([4], [([1, 1, 1, 1], 1)])]\n sage: c2 == c1\n True\n\n We can check that we get the same results if we specify\n ``to_self_function = conj``::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(4, QQ, d1, d2, to_self_function = conj)\n sage: d1 == c1\n True\n sage: d2 == c2\n True\n\n Now we do an example of upper triangularity and check that we get\n the same thing whether or not we specify ``ones_on_diagonal``::\n\n sage: f = lambda p1: lambda p2: QQ(1) if p2 <= p1 else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, upper_triangular=True)\n sage: l(c1[3])\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], 1), ([2, 1], 1)]),\n ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]\n sage: l(c2[3])\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], -1), ([2, 1], 1)]),\n ([3], [([2, 1], -1), ([3], 1)])]\n\n ::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,upper_triangular=True, ones_on_diagonal=True)\n sage: c1 == d1\n True\n sage: c2 == d2\n True\n\n Finally, we do the same thing for lower triangular matrices::\n\n sage: f = lambda p1: lambda p2: QQ(1) if p2 >= p1 else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, lower_triangular=True)\n sage: l(c1[3])\n [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)]),\n ([2, 1], [([2, 1], 1), ([3], 1)]),\n ([3], [([3], 1)])]\n\n ::\n\n sage: l(c2[3])\n [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -1)]),\n ([2, 1], [([2, 1], 1), ([3], -1)]),\n ([3], [([3], 1)])]\n\n ::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,lower_triangular=True, ones_on_diagonal=True)\n sage: c1 == d1\n True\n sage: c2 == d2\n True\n " if (to_other_function is not None): known_cache = self_to_other_cache unknown_cache = other_to_self_cache known_function = to_other_function else: unknown_cache = self_to_other_cache known_cache = other_to_self_cache known_function = to_self_function if ((n in known_cache) and (n in unknown_cache)): return one = base_ring.one() zero = base_ring.zero() pn = sage.combinat.partition.Partitions_n(n).list() len_pn = len(pn) known_cache_n = {} known_matrix_n = matrix(base_ring, len_pn, len_pn) unknown_cache_n = {} for i in range(len_pn): known_cache_part = {} f = known_function(pn[i]) for j in range(len_pn): if (lower_triangular and (j > i)): break if (upper_triangular and (i > j)): continue value = f(pn[j]) if (value != zero): known_cache_part[pn[j]] = value known_matrix_n[(i, j)] = value known_cache_n[pn[i]] = known_cache_part unknown_cache_n[pn[i]] = {} if ((upper_triangular is not False) and (lower_triangular is not False)): raise ValueError('only one of upper_triangular and lower_triangular can be specified') elif (upper_triangular is not False): inverse = copy(known_matrix_n.parent().zero_matrix()) delta = (lambda i: (lambda j: (one if (i == j) else zero))) for column in range(len_pn): e = delta(column) x = ([0] * len_pn) for i in range((len_pn - 1), (- 1), (- 1)): value = e(i) if (not ones_on_diagonal): value /= known_matrix_n[(i, i)] for j in range((i + 1), len_pn): if ones_on_diagonal: value -= (known_matrix_n[(i, j)] * x[j]) else: value -= ((known_matrix_n[(i, j)] * x[j]) / known_matrix_n[(i, i)]) x[i] = value for j in range((column + 1)): if (x[j] != zero): inverse[(j, column)] = x[j] elif (lower_triangular is not False): inverse = copy(known_matrix_n.parent().zero_matrix()) delta = (lambda i: (lambda j: (one if (i == j) else zero))) for column in range(len_pn): e = delta(column) x = [] for i in range(len_pn): value = e(i) if (not ones_on_diagonal): value /= known_matrix_n[(i, i)] for j in range(len(x)): if ones_on_diagonal: value -= (known_matrix_n[(i, j)] * x[j]) else: value -= ((known_matrix_n[(i, j)] * x[j]) / known_matrix_n[(i, i)]) x.append(value) for j in range(column, len(x)): if (x[j] != zero): inverse[(j, column)] = x[j] else: inverse = (~ known_matrix_n) for i in range(len_pn): for j in range(len_pn): if (inverse[(i, j)] != zero): if hasattr(self, '_normalize_coefficients'): unknown_cache_n[pn[i]][pn[j]] = self._normalize_coefficients(inverse[(i, j)]) else: unknown_cache_n[pn[i]][pn[j]] = inverse[(i, j)] known_cache[n] = known_cache_n unknown_cache[n] = unknown_cache_n
def _invert_morphism(self, n, base_ring, self_to_other_cache, other_to_self_cache, to_other_function=None, to_self_function=None, upper_triangular=False, lower_triangular=False, ones_on_diagonal=False): "\n Compute the inverse of a morphism between ``self`` and ``other``\n (more precisely, its `n`-th graded component).\n\n In order to use this, you must be able to compute the morphism in\n one direction. This method assumes that the morphism is indeed\n invertible.\n\n INPUT:\n\n - ``n`` -- an integer, the homogeneous component of\n symmetric functions for which we want to a morphism's inverse\n\n - ``base_ring`` -- the base ring being worked over\n\n - ``self_to_other_cache`` -- a dictionary which\n stores the transition from ``self`` to ``other``\n\n - ``other_to_self_cache`` -- a dictionary which\n stores the transition from ``other`` to ``self``\n\n - ``to_other_function`` -- a function which takes in\n a partition and returns a function which gives the coefficients of\n ``self(part)`` in the ``other`` basis\n\n - ``to_self_function`` -- a function which takes in a\n partition and returns a function which gives the coefficients of\n ``other(part)`` in ``self``\n\n - ``upper_triangular`` -- a boolean, if ``True``, the\n inverse will be computed by back substitution\n\n - ``lower_triangular`` -- a boolean, if ``True``, the\n inverse will be computed by forward substitution\n\n - ``ones_on_diagonal`` -- a boolean, if ``True``, the\n entries on the diagonal of the morphism (and inverse) matrix are\n assumed to be ones. This is used to remove divisions from the\n forward and back substitute algorithms.\n\n OUTPUT:\n\n Nothing is returned, but the caches ``self_to_other_cache``\n and ``other_to_self_cache`` are updated with the `n`-th degree\n components of the respective transition matrices.\n\n EXAMPLES:\n\n First, we will do an example of inverting the morphism\n which sends a Schur function to its conjugate Schur function. Note\n that this is an involution. ::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: conj = lambda p1: lambda p2: QQ(1) if p2 == p1.conjugate() else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(4, QQ, c1, c2, to_other_function = conj)\n sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]\n sage: l(c1[4])\n [([1, 1, 1, 1], [([4], 1)]),\n ([2, 1, 1], [([3, 1], 1)]),\n ([2, 2], [([2, 2], 1)]),\n ([3, 1], [([2, 1, 1], 1)]),\n ([4], [([1, 1, 1, 1], 1)])]\n sage: l(c2[4])\n [([1, 1, 1, 1], [([4], 1)]),\n ([2, 1, 1], [([3, 1], 1)]),\n ([2, 2], [([2, 2], 1)]),\n ([3, 1], [([2, 1, 1], 1)]),\n ([4], [([1, 1, 1, 1], 1)])]\n sage: c2 == c1\n True\n\n We can check that we get the same results if we specify\n ``to_self_function = conj``::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(4, QQ, d1, d2, to_self_function = conj)\n sage: d1 == c1\n True\n sage: d2 == c2\n True\n\n Now we do an example of upper triangularity and check that we get\n the same thing whether or not we specify ``ones_on_diagonal``::\n\n sage: f = lambda p1: lambda p2: QQ(1) if p2 <= p1 else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, upper_triangular=True)\n sage: l(c1[3])\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], 1), ([2, 1], 1)]),\n ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]\n sage: l(c2[3])\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], -1), ([2, 1], 1)]),\n ([3], [([2, 1], -1), ([3], 1)])]\n\n ::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,upper_triangular=True, ones_on_diagonal=True)\n sage: c1 == d1\n True\n sage: c2 == d2\n True\n\n Finally, we do the same thing for lower triangular matrices::\n\n sage: f = lambda p1: lambda p2: QQ(1) if p2 >= p1 else QQ(0)\n sage: c1 = {}\n sage: c2 = {}\n sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, lower_triangular=True)\n sage: l(c1[3])\n [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)]),\n ([2, 1], [([2, 1], 1), ([3], 1)]),\n ([3], [([3], 1)])]\n\n ::\n\n sage: l(c2[3])\n [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -1)]),\n ([2, 1], [([2, 1], 1), ([3], -1)]),\n ([3], [([3], 1)])]\n\n ::\n\n sage: d1 = {}\n sage: d2 = {}\n sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,lower_triangular=True, ones_on_diagonal=True)\n sage: c1 == d1\n True\n sage: c2 == d2\n True\n " if (to_other_function is not None): known_cache = self_to_other_cache unknown_cache = other_to_self_cache known_function = to_other_function else: unknown_cache = self_to_other_cache known_cache = other_to_self_cache known_function = to_self_function if ((n in known_cache) and (n in unknown_cache)): return one = base_ring.one() zero = base_ring.zero() pn = sage.combinat.partition.Partitions_n(n).list() len_pn = len(pn) known_cache_n = {} known_matrix_n = matrix(base_ring, len_pn, len_pn) unknown_cache_n = {} for i in range(len_pn): known_cache_part = {} f = known_function(pn[i]) for j in range(len_pn): if (lower_triangular and (j > i)): break if (upper_triangular and (i > j)): continue value = f(pn[j]) if (value != zero): known_cache_part[pn[j]] = value known_matrix_n[(i, j)] = value known_cache_n[pn[i]] = known_cache_part unknown_cache_n[pn[i]] = {} if ((upper_triangular is not False) and (lower_triangular is not False)): raise ValueError('only one of upper_triangular and lower_triangular can be specified') elif (upper_triangular is not False): inverse = copy(known_matrix_n.parent().zero_matrix()) delta = (lambda i: (lambda j: (one if (i == j) else zero))) for column in range(len_pn): e = delta(column) x = ([0] * len_pn) for i in range((len_pn - 1), (- 1), (- 1)): value = e(i) if (not ones_on_diagonal): value /= known_matrix_n[(i, i)] for j in range((i + 1), len_pn): if ones_on_diagonal: value -= (known_matrix_n[(i, j)] * x[j]) else: value -= ((known_matrix_n[(i, j)] * x[j]) / known_matrix_n[(i, i)]) x[i] = value for j in range((column + 1)): if (x[j] != zero): inverse[(j, column)] = x[j] elif (lower_triangular is not False): inverse = copy(known_matrix_n.parent().zero_matrix()) delta = (lambda i: (lambda j: (one if (i == j) else zero))) for column in range(len_pn): e = delta(column) x = [] for i in range(len_pn): value = e(i) if (not ones_on_diagonal): value /= known_matrix_n[(i, i)] for j in range(len(x)): if ones_on_diagonal: value -= (known_matrix_n[(i, j)] * x[j]) else: value -= ((known_matrix_n[(i, j)] * x[j]) / known_matrix_n[(i, i)]) x.append(value) for j in range(column, len(x)): if (x[j] != zero): inverse[(j, column)] = x[j] else: inverse = (~ known_matrix_n) for i in range(len_pn): for j in range(len_pn): if (inverse[(i, j)] != zero): if hasattr(self, '_normalize_coefficients'): unknown_cache_n[pn[i]][pn[j]] = self._normalize_coefficients(inverse[(i, j)]) else: unknown_cache_n[pn[i]][pn[j]] = inverse[(i, j)] known_cache[n] = known_cache_n unknown_cache[n] = unknown_cache_n<|docstring|>Compute the inverse of a morphism between ``self`` and ``other`` (more precisely, its `n`-th graded component). In order to use this, you must be able to compute the morphism in one direction. This method assumes that the morphism is indeed invertible. INPUT: - ``n`` -- an integer, the homogeneous component of symmetric functions for which we want to a morphism's inverse - ``base_ring`` -- the base ring being worked over - ``self_to_other_cache`` -- a dictionary which stores the transition from ``self`` to ``other`` - ``other_to_self_cache`` -- a dictionary which stores the transition from ``other`` to ``self`` - ``to_other_function`` -- a function which takes in a partition and returns a function which gives the coefficients of ``self(part)`` in the ``other`` basis - ``to_self_function`` -- a function which takes in a partition and returns a function which gives the coefficients of ``other(part)`` in ``self`` - ``upper_triangular`` -- a boolean, if ``True``, the inverse will be computed by back substitution - ``lower_triangular`` -- a boolean, if ``True``, the inverse will be computed by forward substitution - ``ones_on_diagonal`` -- a boolean, if ``True``, the entries on the diagonal of the morphism (and inverse) matrix are assumed to be ones. This is used to remove divisions from the forward and back substitute algorithms. OUTPUT: Nothing is returned, but the caches ``self_to_other_cache`` and ``other_to_self_cache`` are updated with the `n`-th degree components of the respective transition matrices. EXAMPLES: First, we will do an example of inverting the morphism which sends a Schur function to its conjugate Schur function. Note that this is an involution. :: sage: s = SymmetricFunctions(QQ).s() sage: conj = lambda p1: lambda p2: QQ(1) if p2 == p1.conjugate() else QQ(0) sage: c1 = {} sage: c2 = {} sage: s._invert_morphism(4, QQ, c1, c2, to_other_function = conj) sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())] sage: l(c1[4]) [([1, 1, 1, 1], [([4], 1)]), ([2, 1, 1], [([3, 1], 1)]), ([2, 2], [([2, 2], 1)]), ([3, 1], [([2, 1, 1], 1)]), ([4], [([1, 1, 1, 1], 1)])] sage: l(c2[4]) [([1, 1, 1, 1], [([4], 1)]), ([2, 1, 1], [([3, 1], 1)]), ([2, 2], [([2, 2], 1)]), ([3, 1], [([2, 1, 1], 1)]), ([4], [([1, 1, 1, 1], 1)])] sage: c2 == c1 True We can check that we get the same results if we specify ``to_self_function = conj``:: sage: d1 = {} sage: d2 = {} sage: s._invert_morphism(4, QQ, d1, d2, to_self_function = conj) sage: d1 == c1 True sage: d2 == c2 True Now we do an example of upper triangularity and check that we get the same thing whether or not we specify ``ones_on_diagonal``:: sage: f = lambda p1: lambda p2: QQ(1) if p2 <= p1 else QQ(0) sage: c1 = {} sage: c2 = {} sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, upper_triangular=True) sage: l(c1[3]) [([1, 1, 1], [([1, 1, 1], 1)]), ([2, 1], [([1, 1, 1], 1), ([2, 1], 1)]), ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])] sage: l(c2[3]) [([1, 1, 1], [([1, 1, 1], 1)]), ([2, 1], [([1, 1, 1], -1), ([2, 1], 1)]), ([3], [([2, 1], -1), ([3], 1)])] :: sage: d1 = {} sage: d2 = {} sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,upper_triangular=True, ones_on_diagonal=True) sage: c1 == d1 True sage: c2 == d2 True Finally, we do the same thing for lower triangular matrices:: sage: f = lambda p1: lambda p2: QQ(1) if p2 >= p1 else QQ(0) sage: c1 = {} sage: c2 = {} sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, lower_triangular=True) sage: l(c1[3]) [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)]), ([2, 1], [([2, 1], 1), ([3], 1)]), ([3], [([3], 1)])] :: sage: l(c2[3]) [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -1)]), ([2, 1], [([2, 1], 1), ([3], -1)]), ([3], [([3], 1)])] :: sage: d1 = {} sage: d2 = {} sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,lower_triangular=True, ones_on_diagonal=True) sage: c1 == d1 True sage: c2 == d2 True<|endoftext|>
0bd71aa1cc0e559c9b843be7dec8d6cfba938043d2ad2477c4721f44eab20f8c
def symmetric_function_ring(self): "\n Return the family of symmetric functions associated to the\n basis ``self``.\n\n OUTPUT:\n\n - returns an instance of the ring of symmetric functions\n\n EXAMPLES::\n\n sage: schur = SymmetricFunctions(QQ).schur()\n sage: schur.symmetric_function_ring()\n Symmetric Functions over Rational Field\n sage: power = SymmetricFunctions(QQ['t']).power()\n sage: power.symmetric_function_ring()\n Symmetric Functions over Univariate Polynomial Ring in t over Rational Field\n " return self.realization_of()
Return the family of symmetric functions associated to the basis ``self``. OUTPUT: - returns an instance of the ring of symmetric functions EXAMPLES:: sage: schur = SymmetricFunctions(QQ).schur() sage: schur.symmetric_function_ring() Symmetric Functions over Rational Field sage: power = SymmetricFunctions(QQ['t']).power() sage: power.symmetric_function_ring() Symmetric Functions over Univariate Polynomial Ring in t over Rational Field
src/sage/combinat/sf/sfa.py
symmetric_function_ring
bopopescu/sagesmc
5
python
def symmetric_function_ring(self): "\n Return the family of symmetric functions associated to the\n basis ``self``.\n\n OUTPUT:\n\n - returns an instance of the ring of symmetric functions\n\n EXAMPLES::\n\n sage: schur = SymmetricFunctions(QQ).schur()\n sage: schur.symmetric_function_ring()\n Symmetric Functions over Rational Field\n sage: power = SymmetricFunctions(QQ['t']).power()\n sage: power.symmetric_function_ring()\n Symmetric Functions over Univariate Polynomial Ring in t over Rational Field\n " return self.realization_of()
def symmetric_function_ring(self): "\n Return the family of symmetric functions associated to the\n basis ``self``.\n\n OUTPUT:\n\n - returns an instance of the ring of symmetric functions\n\n EXAMPLES::\n\n sage: schur = SymmetricFunctions(QQ).schur()\n sage: schur.symmetric_function_ring()\n Symmetric Functions over Rational Field\n sage: power = SymmetricFunctions(QQ['t']).power()\n sage: power.symmetric_function_ring()\n Symmetric Functions over Univariate Polynomial Ring in t over Rational Field\n " return self.realization_of()<|docstring|>Return the family of symmetric functions associated to the basis ``self``. OUTPUT: - returns an instance of the ring of symmetric functions EXAMPLES:: sage: schur = SymmetricFunctions(QQ).schur() sage: schur.symmetric_function_ring() Symmetric Functions over Rational Field sage: power = SymmetricFunctions(QQ['t']).power() sage: power.symmetric_function_ring() Symmetric Functions over Univariate Polynomial Ring in t over Rational Field<|endoftext|>
69f360a5dfada7070324b12353a9cb6671b44714dfd612f83e2f54822fc5a271
def prefix(self): "\n Return the prefix on the elements of ``self``.\n\n EXAMPLES::\n\n sage: schur = SymmetricFunctions(QQ).schur()\n sage: schur([3,2,1])\n s[3, 2, 1]\n sage: schur.prefix()\n 's'\n " return self._prefix
Return the prefix on the elements of ``self``. EXAMPLES:: sage: schur = SymmetricFunctions(QQ).schur() sage: schur([3,2,1]) s[3, 2, 1] sage: schur.prefix() 's'
src/sage/combinat/sf/sfa.py
prefix
bopopescu/sagesmc
5
python
def prefix(self): "\n Return the prefix on the elements of ``self``.\n\n EXAMPLES::\n\n sage: schur = SymmetricFunctions(QQ).schur()\n sage: schur([3,2,1])\n s[3, 2, 1]\n sage: schur.prefix()\n 's'\n " return self._prefix
def prefix(self): "\n Return the prefix on the elements of ``self``.\n\n EXAMPLES::\n\n sage: schur = SymmetricFunctions(QQ).schur()\n sage: schur([3,2,1])\n s[3, 2, 1]\n sage: schur.prefix()\n 's'\n " return self._prefix<|docstring|>Return the prefix on the elements of ``self``. EXAMPLES:: sage: schur = SymmetricFunctions(QQ).schur() sage: schur([3,2,1]) s[3, 2, 1] sage: schur.prefix() 's'<|endoftext|>
342c62019f81fc2cf07b19199d462d7384e0378705df4e5bdbefb167b9afd688
def transition_matrix(self, basis, n): '\n Return the transition matrix between ``self`` and ``basis`` for the\n homogeneous component of degree ``n``.\n\n INPUT:\n\n - ``basis`` -- a basis of the ring of symmetric functions\n - ``n`` -- a nonnegative integer\n\n OUTPUT:\n\n - a matrix of coefficients giving the expansion of the\n homogeneous degree-`n` elements of ``self`` in the\n degree-`n` elements of ``basis``\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: m = SymmetricFunctions(QQ).m()\n sage: s.transition_matrix(m,5)\n [1 1 1 1 1 1 1]\n [0 1 1 2 2 3 4]\n [0 0 1 1 2 3 5]\n [0 0 0 1 1 3 6]\n [0 0 0 0 1 2 5]\n [0 0 0 0 0 1 4]\n [0 0 0 0 0 0 1]\n sage: s.transition_matrix(m,1)\n [1]\n sage: s.transition_matrix(m,0)\n [1]\n\n ::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: s.transition_matrix(p, 4)\n [ 1/4 1/3 1/8 1/4 1/24]\n [-1/4 0 -1/8 1/4 1/8]\n [ 0 -1/3 1/4 0 1/12]\n [ 1/4 0 -1/8 -1/4 1/8]\n [-1/4 1/3 1/8 -1/4 1/24]\n sage: StoP = s.transition_matrix(p,4)\n sage: a = s([3,1])+5*s([1,1,1,1])-s([4])\n sage: a\n 5*s[1, 1, 1, 1] + s[3, 1] - s[4]\n sage: mon = a.support()\n sage: coeffs = a.coefficients()\n sage: coeffs\n [5, 1, -1]\n sage: mon\n [[1, 1, 1, 1], [3, 1], [4]]\n sage: cm = matrix([[-1,1,0,0,5]])\n sage: cm * StoP\n [-7/4 4/3 3/8 -5/4 7/24]\n sage: p(a)\n 7/24*p[1, 1, 1, 1] - 5/4*p[2, 1, 1] + 3/8*p[2, 2] + 4/3*p[3, 1] - 7/4*p[4]\n\n ::\n\n sage: h = SymmetricFunctions(QQ).h()\n sage: e = SymmetricFunctions(QQ).e()\n sage: s.transition_matrix(m,7) == h.transition_matrix(s,7).transpose()\n True\n\n ::\n\n sage: h.transition_matrix(m, 7) == h.transition_matrix(m, 7).transpose()\n True\n\n ::\n\n sage: h.transition_matrix(e, 7) == e.transition_matrix(h, 7)\n True\n\n ::\n\n sage: p.transition_matrix(s, 5)\n [ 1 -1 0 1 0 -1 1]\n [ 1 0 -1 0 1 0 -1]\n [ 1 -1 1 0 -1 1 -1]\n [ 1 1 -1 0 -1 1 1]\n [ 1 0 1 -2 1 0 1]\n [ 1 2 1 0 -1 -2 -1]\n [ 1 4 5 6 5 4 1]\n\n ::\n\n sage: e.transition_matrix(m,7) == e.transition_matrix(m,7).transpose()\n True\n ' P = sage.combinat.partition.Partitions_n(n) Plist = P.list() m = [] for row_part in Plist: z = basis(self(row_part)) m.append(map((lambda col_part: z.coefficient(col_part)), Plist)) return matrix(m)
Return the transition matrix between ``self`` and ``basis`` for the homogeneous component of degree ``n``. INPUT: - ``basis`` -- a basis of the ring of symmetric functions - ``n`` -- a nonnegative integer OUTPUT: - a matrix of coefficients giving the expansion of the homogeneous degree-`n` elements of ``self`` in the degree-`n` elements of ``basis`` EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: m = SymmetricFunctions(QQ).m() sage: s.transition_matrix(m,5) [1 1 1 1 1 1 1] [0 1 1 2 2 3 4] [0 0 1 1 2 3 5] [0 0 0 1 1 3 6] [0 0 0 0 1 2 5] [0 0 0 0 0 1 4] [0 0 0 0 0 0 1] sage: s.transition_matrix(m,1) [1] sage: s.transition_matrix(m,0) [1] :: sage: p = SymmetricFunctions(QQ).p() sage: s.transition_matrix(p, 4) [ 1/4 1/3 1/8 1/4 1/24] [-1/4 0 -1/8 1/4 1/8] [ 0 -1/3 1/4 0 1/12] [ 1/4 0 -1/8 -1/4 1/8] [-1/4 1/3 1/8 -1/4 1/24] sage: StoP = s.transition_matrix(p,4) sage: a = s([3,1])+5*s([1,1,1,1])-s([4]) sage: a 5*s[1, 1, 1, 1] + s[3, 1] - s[4] sage: mon = a.support() sage: coeffs = a.coefficients() sage: coeffs [5, 1, -1] sage: mon [[1, 1, 1, 1], [3, 1], [4]] sage: cm = matrix([[-1,1,0,0,5]]) sage: cm * StoP [-7/4 4/3 3/8 -5/4 7/24] sage: p(a) 7/24*p[1, 1, 1, 1] - 5/4*p[2, 1, 1] + 3/8*p[2, 2] + 4/3*p[3, 1] - 7/4*p[4] :: sage: h = SymmetricFunctions(QQ).h() sage: e = SymmetricFunctions(QQ).e() sage: s.transition_matrix(m,7) == h.transition_matrix(s,7).transpose() True :: sage: h.transition_matrix(m, 7) == h.transition_matrix(m, 7).transpose() True :: sage: h.transition_matrix(e, 7) == e.transition_matrix(h, 7) True :: sage: p.transition_matrix(s, 5) [ 1 -1 0 1 0 -1 1] [ 1 0 -1 0 1 0 -1] [ 1 -1 1 0 -1 1 -1] [ 1 1 -1 0 -1 1 1] [ 1 0 1 -2 1 0 1] [ 1 2 1 0 -1 -2 -1] [ 1 4 5 6 5 4 1] :: sage: e.transition_matrix(m,7) == e.transition_matrix(m,7).transpose() True
src/sage/combinat/sf/sfa.py
transition_matrix
bopopescu/sagesmc
5
python
def transition_matrix(self, basis, n): '\n Return the transition matrix between ``self`` and ``basis`` for the\n homogeneous component of degree ``n``.\n\n INPUT:\n\n - ``basis`` -- a basis of the ring of symmetric functions\n - ``n`` -- a nonnegative integer\n\n OUTPUT:\n\n - a matrix of coefficients giving the expansion of the\n homogeneous degree-`n` elements of ``self`` in the\n degree-`n` elements of ``basis``\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: m = SymmetricFunctions(QQ).m()\n sage: s.transition_matrix(m,5)\n [1 1 1 1 1 1 1]\n [0 1 1 2 2 3 4]\n [0 0 1 1 2 3 5]\n [0 0 0 1 1 3 6]\n [0 0 0 0 1 2 5]\n [0 0 0 0 0 1 4]\n [0 0 0 0 0 0 1]\n sage: s.transition_matrix(m,1)\n [1]\n sage: s.transition_matrix(m,0)\n [1]\n\n ::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: s.transition_matrix(p, 4)\n [ 1/4 1/3 1/8 1/4 1/24]\n [-1/4 0 -1/8 1/4 1/8]\n [ 0 -1/3 1/4 0 1/12]\n [ 1/4 0 -1/8 -1/4 1/8]\n [-1/4 1/3 1/8 -1/4 1/24]\n sage: StoP = s.transition_matrix(p,4)\n sage: a = s([3,1])+5*s([1,1,1,1])-s([4])\n sage: a\n 5*s[1, 1, 1, 1] + s[3, 1] - s[4]\n sage: mon = a.support()\n sage: coeffs = a.coefficients()\n sage: coeffs\n [5, 1, -1]\n sage: mon\n [[1, 1, 1, 1], [3, 1], [4]]\n sage: cm = matrix([[-1,1,0,0,5]])\n sage: cm * StoP\n [-7/4 4/3 3/8 -5/4 7/24]\n sage: p(a)\n 7/24*p[1, 1, 1, 1] - 5/4*p[2, 1, 1] + 3/8*p[2, 2] + 4/3*p[3, 1] - 7/4*p[4]\n\n ::\n\n sage: h = SymmetricFunctions(QQ).h()\n sage: e = SymmetricFunctions(QQ).e()\n sage: s.transition_matrix(m,7) == h.transition_matrix(s,7).transpose()\n True\n\n ::\n\n sage: h.transition_matrix(m, 7) == h.transition_matrix(m, 7).transpose()\n True\n\n ::\n\n sage: h.transition_matrix(e, 7) == e.transition_matrix(h, 7)\n True\n\n ::\n\n sage: p.transition_matrix(s, 5)\n [ 1 -1 0 1 0 -1 1]\n [ 1 0 -1 0 1 0 -1]\n [ 1 -1 1 0 -1 1 -1]\n [ 1 1 -1 0 -1 1 1]\n [ 1 0 1 -2 1 0 1]\n [ 1 2 1 0 -1 -2 -1]\n [ 1 4 5 6 5 4 1]\n\n ::\n\n sage: e.transition_matrix(m,7) == e.transition_matrix(m,7).transpose()\n True\n ' P = sage.combinat.partition.Partitions_n(n) Plist = P.list() m = [] for row_part in Plist: z = basis(self(row_part)) m.append(map((lambda col_part: z.coefficient(col_part)), Plist)) return matrix(m)
def transition_matrix(self, basis, n): '\n Return the transition matrix between ``self`` and ``basis`` for the\n homogeneous component of degree ``n``.\n\n INPUT:\n\n - ``basis`` -- a basis of the ring of symmetric functions\n - ``n`` -- a nonnegative integer\n\n OUTPUT:\n\n - a matrix of coefficients giving the expansion of the\n homogeneous degree-`n` elements of ``self`` in the\n degree-`n` elements of ``basis``\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: m = SymmetricFunctions(QQ).m()\n sage: s.transition_matrix(m,5)\n [1 1 1 1 1 1 1]\n [0 1 1 2 2 3 4]\n [0 0 1 1 2 3 5]\n [0 0 0 1 1 3 6]\n [0 0 0 0 1 2 5]\n [0 0 0 0 0 1 4]\n [0 0 0 0 0 0 1]\n sage: s.transition_matrix(m,1)\n [1]\n sage: s.transition_matrix(m,0)\n [1]\n\n ::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: s.transition_matrix(p, 4)\n [ 1/4 1/3 1/8 1/4 1/24]\n [-1/4 0 -1/8 1/4 1/8]\n [ 0 -1/3 1/4 0 1/12]\n [ 1/4 0 -1/8 -1/4 1/8]\n [-1/4 1/3 1/8 -1/4 1/24]\n sage: StoP = s.transition_matrix(p,4)\n sage: a = s([3,1])+5*s([1,1,1,1])-s([4])\n sage: a\n 5*s[1, 1, 1, 1] + s[3, 1] - s[4]\n sage: mon = a.support()\n sage: coeffs = a.coefficients()\n sage: coeffs\n [5, 1, -1]\n sage: mon\n [[1, 1, 1, 1], [3, 1], [4]]\n sage: cm = matrix([[-1,1,0,0,5]])\n sage: cm * StoP\n [-7/4 4/3 3/8 -5/4 7/24]\n sage: p(a)\n 7/24*p[1, 1, 1, 1] - 5/4*p[2, 1, 1] + 3/8*p[2, 2] + 4/3*p[3, 1] - 7/4*p[4]\n\n ::\n\n sage: h = SymmetricFunctions(QQ).h()\n sage: e = SymmetricFunctions(QQ).e()\n sage: s.transition_matrix(m,7) == h.transition_matrix(s,7).transpose()\n True\n\n ::\n\n sage: h.transition_matrix(m, 7) == h.transition_matrix(m, 7).transpose()\n True\n\n ::\n\n sage: h.transition_matrix(e, 7) == e.transition_matrix(h, 7)\n True\n\n ::\n\n sage: p.transition_matrix(s, 5)\n [ 1 -1 0 1 0 -1 1]\n [ 1 0 -1 0 1 0 -1]\n [ 1 -1 1 0 -1 1 -1]\n [ 1 1 -1 0 -1 1 1]\n [ 1 0 1 -2 1 0 1]\n [ 1 2 1 0 -1 -2 -1]\n [ 1 4 5 6 5 4 1]\n\n ::\n\n sage: e.transition_matrix(m,7) == e.transition_matrix(m,7).transpose()\n True\n ' P = sage.combinat.partition.Partitions_n(n) Plist = P.list() m = [] for row_part in Plist: z = basis(self(row_part)) m.append(map((lambda col_part: z.coefficient(col_part)), Plist)) return matrix(m)<|docstring|>Return the transition matrix between ``self`` and ``basis`` for the homogeneous component of degree ``n``. INPUT: - ``basis`` -- a basis of the ring of symmetric functions - ``n`` -- a nonnegative integer OUTPUT: - a matrix of coefficients giving the expansion of the homogeneous degree-`n` elements of ``self`` in the degree-`n` elements of ``basis`` EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: m = SymmetricFunctions(QQ).m() sage: s.transition_matrix(m,5) [1 1 1 1 1 1 1] [0 1 1 2 2 3 4] [0 0 1 1 2 3 5] [0 0 0 1 1 3 6] [0 0 0 0 1 2 5] [0 0 0 0 0 1 4] [0 0 0 0 0 0 1] sage: s.transition_matrix(m,1) [1] sage: s.transition_matrix(m,0) [1] :: sage: p = SymmetricFunctions(QQ).p() sage: s.transition_matrix(p, 4) [ 1/4 1/3 1/8 1/4 1/24] [-1/4 0 -1/8 1/4 1/8] [ 0 -1/3 1/4 0 1/12] [ 1/4 0 -1/8 -1/4 1/8] [-1/4 1/3 1/8 -1/4 1/24] sage: StoP = s.transition_matrix(p,4) sage: a = s([3,1])+5*s([1,1,1,1])-s([4]) sage: a 5*s[1, 1, 1, 1] + s[3, 1] - s[4] sage: mon = a.support() sage: coeffs = a.coefficients() sage: coeffs [5, 1, -1] sage: mon [[1, 1, 1, 1], [3, 1], [4]] sage: cm = matrix([[-1,1,0,0,5]]) sage: cm * StoP [-7/4 4/3 3/8 -5/4 7/24] sage: p(a) 7/24*p[1, 1, 1, 1] - 5/4*p[2, 1, 1] + 3/8*p[2, 2] + 4/3*p[3, 1] - 7/4*p[4] :: sage: h = SymmetricFunctions(QQ).h() sage: e = SymmetricFunctions(QQ).e() sage: s.transition_matrix(m,7) == h.transition_matrix(s,7).transpose() True :: sage: h.transition_matrix(m, 7) == h.transition_matrix(m, 7).transpose() True :: sage: h.transition_matrix(e, 7) == e.transition_matrix(h, 7) True :: sage: p.transition_matrix(s, 5) [ 1 -1 0 1 0 -1 1] [ 1 0 -1 0 1 0 -1] [ 1 -1 1 0 -1 1 -1] [ 1 1 -1 0 -1 1 1] [ 1 0 1 -2 1 0 1] [ 1 2 1 0 -1 -2 -1] [ 1 4 5 6 5 4 1] :: sage: e.transition_matrix(m,7) == e.transition_matrix(m,7).transpose() True<|endoftext|>
3827c72ae4dd4d8bc42b48f58be2f910d272ae665ff03cbcdab5b08c9fdae004
def _gram_schmidt(self, n, source, scalar, cache, leading_coeff=None, upper_triangular=True): "\n Apply Gram-Schmidt to ``source`` with respect to the scalar product\n ``scalar`` for all partitions of `n`. The scalar product is supposed\n to make the power-sum basis orthogonal. The Gram-Schmidt algorithm\n computes an orthogonal basis (with respect to the scalar product\n given by ``scalar``) of the `n`-th homogeneous component of the\n ring of symmetric functions such that the transition matrix from\n the basis ``source`` to this orthogonal basis is triangular.\n\n The result is not returned, but instead, the coefficients of the\n elements of the orthogonal basis with respect to the basis\n ``source`` are stored in the cache ``cache``.\n\n The implementation uses the powersum basis, so this function\n shouldn't be used unless the base ring is a `\\QQ`-algebra\n (or ``self`` and ``source`` are both the powersum basis).\n\n INPUT:\n\n - ``n`` -- nonnegative integer which specifies the size of\n the partitions\n - ``source`` -- a basis of the ring of symmetric functions\n - ``scalar`` -- a function ``zee`` from partitions to the base ring\n which specifies the scalar product by `\\langle p_{\\lambda},\n p_{\\lambda} \\rangle = \\mathrm{zee}(\\lambda)`.\n - ``cache`` -- a cache function\n - ``leading_coeff`` -- (default: ``None``) specifies the leading\n coefficients for Gram-Schmidt\n - ``upper_triangular`` -- (defaults to ``True``) boolean, indicates\n whether the transition is upper triangular or not\n\n EXAMPLES::\n\n sage: cache = {}\n sage: from sage.combinat.sf.sfa import zee\n sage: s = SymmetricFunctions(QQ).s()\n sage: m = SymmetricFunctions(QQ).m()\n sage: s._gram_schmidt(3, m, zee, cache)\n sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]\n sage: l(cache)\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], 2), ([2, 1], 1)]),\n ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]\n " BR = self.base_ring() one = BR.one() p = self.realization_of().p() pscalar = (lambda x, y: p._apply_multi_module_morphism(p(x), p(y), (lambda a, b: scalar(a)), orthogonal=True)) if (leading_coeff is None): leading_coeff = (lambda x: one) l = Partitions(n).list() if upper_triangular: l.reverse() precomputed_elements = [] cache[l[0]] = {l[0]: leading_coeff(l[0])} precomputed_elements.append((leading_coeff(l[0]) * source(l[0]))) for i in range(1, len(l)): start = (leading_coeff(l[i]) * source(l[i])) sub = 0 for j in range(i): sub += ((pscalar(start, precomputed_elements[j]) / pscalar(precomputed_elements[j], precomputed_elements[j])) * precomputed_elements[j]) res = (start - sub) if hasattr(self, '_normalize_coefficients'): res = res.map_coefficients(self._normalize_coefficients) precomputed_elements.append(res) cache[l[i]] = {} for j in range((i + 1)): cache[l[i]][l[j]] = res.coefficient(l[j])
Apply Gram-Schmidt to ``source`` with respect to the scalar product ``scalar`` for all partitions of `n`. The scalar product is supposed to make the power-sum basis orthogonal. The Gram-Schmidt algorithm computes an orthogonal basis (with respect to the scalar product given by ``scalar``) of the `n`-th homogeneous component of the ring of symmetric functions such that the transition matrix from the basis ``source`` to this orthogonal basis is triangular. The result is not returned, but instead, the coefficients of the elements of the orthogonal basis with respect to the basis ``source`` are stored in the cache ``cache``. The implementation uses the powersum basis, so this function shouldn't be used unless the base ring is a `\QQ`-algebra (or ``self`` and ``source`` are both the powersum basis). INPUT: - ``n`` -- nonnegative integer which specifies the size of the partitions - ``source`` -- a basis of the ring of symmetric functions - ``scalar`` -- a function ``zee`` from partitions to the base ring which specifies the scalar product by `\langle p_{\lambda}, p_{\lambda} \rangle = \mathrm{zee}(\lambda)`. - ``cache`` -- a cache function - ``leading_coeff`` -- (default: ``None``) specifies the leading coefficients for Gram-Schmidt - ``upper_triangular`` -- (defaults to ``True``) boolean, indicates whether the transition is upper triangular or not EXAMPLES:: sage: cache = {} sage: from sage.combinat.sf.sfa import zee sage: s = SymmetricFunctions(QQ).s() sage: m = SymmetricFunctions(QQ).m() sage: s._gram_schmidt(3, m, zee, cache) sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())] sage: l(cache) [([1, 1, 1], [([1, 1, 1], 1)]), ([2, 1], [([1, 1, 1], 2), ([2, 1], 1)]), ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]
src/sage/combinat/sf/sfa.py
_gram_schmidt
bopopescu/sagesmc
5
python
def _gram_schmidt(self, n, source, scalar, cache, leading_coeff=None, upper_triangular=True): "\n Apply Gram-Schmidt to ``source`` with respect to the scalar product\n ``scalar`` for all partitions of `n`. The scalar product is supposed\n to make the power-sum basis orthogonal. The Gram-Schmidt algorithm\n computes an orthogonal basis (with respect to the scalar product\n given by ``scalar``) of the `n`-th homogeneous component of the\n ring of symmetric functions such that the transition matrix from\n the basis ``source`` to this orthogonal basis is triangular.\n\n The result is not returned, but instead, the coefficients of the\n elements of the orthogonal basis with respect to the basis\n ``source`` are stored in the cache ``cache``.\n\n The implementation uses the powersum basis, so this function\n shouldn't be used unless the base ring is a `\\QQ`-algebra\n (or ``self`` and ``source`` are both the powersum basis).\n\n INPUT:\n\n - ``n`` -- nonnegative integer which specifies the size of\n the partitions\n - ``source`` -- a basis of the ring of symmetric functions\n - ``scalar`` -- a function ``zee`` from partitions to the base ring\n which specifies the scalar product by `\\langle p_{\\lambda},\n p_{\\lambda} \\rangle = \\mathrm{zee}(\\lambda)`.\n - ``cache`` -- a cache function\n - ``leading_coeff`` -- (default: ``None``) specifies the leading\n coefficients for Gram-Schmidt\n - ``upper_triangular`` -- (defaults to ``True``) boolean, indicates\n whether the transition is upper triangular or not\n\n EXAMPLES::\n\n sage: cache = {}\n sage: from sage.combinat.sf.sfa import zee\n sage: s = SymmetricFunctions(QQ).s()\n sage: m = SymmetricFunctions(QQ).m()\n sage: s._gram_schmidt(3, m, zee, cache)\n sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]\n sage: l(cache)\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], 2), ([2, 1], 1)]),\n ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]\n " BR = self.base_ring() one = BR.one() p = self.realization_of().p() pscalar = (lambda x, y: p._apply_multi_module_morphism(p(x), p(y), (lambda a, b: scalar(a)), orthogonal=True)) if (leading_coeff is None): leading_coeff = (lambda x: one) l = Partitions(n).list() if upper_triangular: l.reverse() precomputed_elements = [] cache[l[0]] = {l[0]: leading_coeff(l[0])} precomputed_elements.append((leading_coeff(l[0]) * source(l[0]))) for i in range(1, len(l)): start = (leading_coeff(l[i]) * source(l[i])) sub = 0 for j in range(i): sub += ((pscalar(start, precomputed_elements[j]) / pscalar(precomputed_elements[j], precomputed_elements[j])) * precomputed_elements[j]) res = (start - sub) if hasattr(self, '_normalize_coefficients'): res = res.map_coefficients(self._normalize_coefficients) precomputed_elements.append(res) cache[l[i]] = {} for j in range((i + 1)): cache[l[i]][l[j]] = res.coefficient(l[j])
def _gram_schmidt(self, n, source, scalar, cache, leading_coeff=None, upper_triangular=True): "\n Apply Gram-Schmidt to ``source`` with respect to the scalar product\n ``scalar`` for all partitions of `n`. The scalar product is supposed\n to make the power-sum basis orthogonal. The Gram-Schmidt algorithm\n computes an orthogonal basis (with respect to the scalar product\n given by ``scalar``) of the `n`-th homogeneous component of the\n ring of symmetric functions such that the transition matrix from\n the basis ``source`` to this orthogonal basis is triangular.\n\n The result is not returned, but instead, the coefficients of the\n elements of the orthogonal basis with respect to the basis\n ``source`` are stored in the cache ``cache``.\n\n The implementation uses the powersum basis, so this function\n shouldn't be used unless the base ring is a `\\QQ`-algebra\n (or ``self`` and ``source`` are both the powersum basis).\n\n INPUT:\n\n - ``n`` -- nonnegative integer which specifies the size of\n the partitions\n - ``source`` -- a basis of the ring of symmetric functions\n - ``scalar`` -- a function ``zee`` from partitions to the base ring\n which specifies the scalar product by `\\langle p_{\\lambda},\n p_{\\lambda} \\rangle = \\mathrm{zee}(\\lambda)`.\n - ``cache`` -- a cache function\n - ``leading_coeff`` -- (default: ``None``) specifies the leading\n coefficients for Gram-Schmidt\n - ``upper_triangular`` -- (defaults to ``True``) boolean, indicates\n whether the transition is upper triangular or not\n\n EXAMPLES::\n\n sage: cache = {}\n sage: from sage.combinat.sf.sfa import zee\n sage: s = SymmetricFunctions(QQ).s()\n sage: m = SymmetricFunctions(QQ).m()\n sage: s._gram_schmidt(3, m, zee, cache)\n sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]\n sage: l(cache)\n [([1, 1, 1], [([1, 1, 1], 1)]),\n ([2, 1], [([1, 1, 1], 2), ([2, 1], 1)]),\n ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]\n " BR = self.base_ring() one = BR.one() p = self.realization_of().p() pscalar = (lambda x, y: p._apply_multi_module_morphism(p(x), p(y), (lambda a, b: scalar(a)), orthogonal=True)) if (leading_coeff is None): leading_coeff = (lambda x: one) l = Partitions(n).list() if upper_triangular: l.reverse() precomputed_elements = [] cache[l[0]] = {l[0]: leading_coeff(l[0])} precomputed_elements.append((leading_coeff(l[0]) * source(l[0]))) for i in range(1, len(l)): start = (leading_coeff(l[i]) * source(l[i])) sub = 0 for j in range(i): sub += ((pscalar(start, precomputed_elements[j]) / pscalar(precomputed_elements[j], precomputed_elements[j])) * precomputed_elements[j]) res = (start - sub) if hasattr(self, '_normalize_coefficients'): res = res.map_coefficients(self._normalize_coefficients) precomputed_elements.append(res) cache[l[i]] = {} for j in range((i + 1)): cache[l[i]][l[j]] = res.coefficient(l[j])<|docstring|>Apply Gram-Schmidt to ``source`` with respect to the scalar product ``scalar`` for all partitions of `n`. The scalar product is supposed to make the power-sum basis orthogonal. The Gram-Schmidt algorithm computes an orthogonal basis (with respect to the scalar product given by ``scalar``) of the `n`-th homogeneous component of the ring of symmetric functions such that the transition matrix from the basis ``source`` to this orthogonal basis is triangular. The result is not returned, but instead, the coefficients of the elements of the orthogonal basis with respect to the basis ``source`` are stored in the cache ``cache``. The implementation uses the powersum basis, so this function shouldn't be used unless the base ring is a `\QQ`-algebra (or ``self`` and ``source`` are both the powersum basis). INPUT: - ``n`` -- nonnegative integer which specifies the size of the partitions - ``source`` -- a basis of the ring of symmetric functions - ``scalar`` -- a function ``zee`` from partitions to the base ring which specifies the scalar product by `\langle p_{\lambda}, p_{\lambda} \rangle = \mathrm{zee}(\lambda)`. - ``cache`` -- a cache function - ``leading_coeff`` -- (default: ``None``) specifies the leading coefficients for Gram-Schmidt - ``upper_triangular`` -- (defaults to ``True``) boolean, indicates whether the transition is upper triangular or not EXAMPLES:: sage: cache = {} sage: from sage.combinat.sf.sfa import zee sage: s = SymmetricFunctions(QQ).s() sage: m = SymmetricFunctions(QQ).m() sage: s._gram_schmidt(3, m, zee, cache) sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())] sage: l(cache) [([1, 1, 1], [([1, 1, 1], 1)]), ([2, 1], [([1, 1, 1], 2), ([2, 1], 1)]), ([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]<|endoftext|>
dd2e917d5cc382d1f2493bf70393e0116d661a3dab8facdd3afbc471ac45eead
def _inner_plethysm_pk_g(self, k, g, cache): '\n Return the inner plethysm between the power-sum symmetric\n function `p_k` and the symmetric function ``g``.\n\n See :meth:`inner_plethysm` for the definition of inner\n plethysm.\n\n .. WARNING::\n\n The function ``g`` *must* be given in the power-sum\n basis for this method to return a correct result.\n\n ALGORITHM:\n\n Express ``g`` in the power sum basis as\n `g = \\sum_\\mu c_\\mu p_\\mu/z_\\mu`\n (where `z_\\mu` is the size of the centralizer of any\n permutation with cycle type `\\mu`). Then, the inner plethysm\n is calculated as\n\n .. MATH::\n\n p_k \\{ g \\} = \\sum_\\mu c_\\mu p_k \\{ p_\\mu/z_\\mu \\}~.\n\n The inner plethysm `p_k \\{ p_mu/z_\\mu \\}` is given by the formula\n\n .. MATH::\n\n p_k \\{ p_\\mu/z_\\mu \\} = \\sum_{\\nu : \\nu^k = \\mu } p_{\\nu}/z_{\\nu}~,\n\n where `\\nu^k` is the `k`-th power of `nu` (see\n :~sage.combinat.partition.partition_power`).\n\n .. SEEALSO:: :func:`~sage.combinat.partition.partition_power`,\n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm`\n\n INPUT:\n\n - ``k`` -- a positive integer\n\n - ``g`` -- a symmetric function in the power sum basis\n\n - ``cache`` -- a dictionary whose keys are (k, g) pairs\n and values are the cached output of this function\n\n EXAMPLES::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: p._inner_plethysm_pk_g(2, p([1,1,1]), {})\n p[1, 1, 1] + 3*p[2, 1]\n sage: p._inner_plethysm_pk_g(5, p([2,2,1,1,1]), {})\n p[2, 2, 1, 1, 1]\n ' try: return cache[(k, g)] except KeyError: pass p = self.realization_of().p() res = 0 degrees = uniq([sum(m) for m in g.support()]) for d in degrees: for mu in sage.combinat.partition.Partitions(d): mu_k = mu.power(k) if (mu_k in g): res += (((g.coefficient(mu_k) * mu_k.centralizer_size()) / mu.centralizer_size()) * p(mu)) cache[(k, g)] = res return res
Return the inner plethysm between the power-sum symmetric function `p_k` and the symmetric function ``g``. See :meth:`inner_plethysm` for the definition of inner plethysm. .. WARNING:: The function ``g`` *must* be given in the power-sum basis for this method to return a correct result. ALGORITHM: Express ``g`` in the power sum basis as `g = \sum_\mu c_\mu p_\mu/z_\mu` (where `z_\mu` is the size of the centralizer of any permutation with cycle type `\mu`). Then, the inner plethysm is calculated as .. MATH:: p_k \{ g \} = \sum_\mu c_\mu p_k \{ p_\mu/z_\mu \}~. The inner plethysm `p_k \{ p_mu/z_\mu \}` is given by the formula .. MATH:: p_k \{ p_\mu/z_\mu \} = \sum_{\nu : \nu^k = \mu } p_{\nu}/z_{\nu}~, where `\nu^k` is the `k`-th power of `nu` (see :~sage.combinat.partition.partition_power`). .. SEEALSO:: :func:`~sage.combinat.partition.partition_power`, :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm` INPUT: - ``k`` -- a positive integer - ``g`` -- a symmetric function in the power sum basis - ``cache`` -- a dictionary whose keys are (k, g) pairs and values are the cached output of this function EXAMPLES:: sage: p = SymmetricFunctions(QQ).p() sage: p._inner_plethysm_pk_g(2, p([1,1,1]), {}) p[1, 1, 1] + 3*p[2, 1] sage: p._inner_plethysm_pk_g(5, p([2,2,1,1,1]), {}) p[2, 2, 1, 1, 1]
src/sage/combinat/sf/sfa.py
_inner_plethysm_pk_g
bopopescu/sagesmc
5
python
def _inner_plethysm_pk_g(self, k, g, cache): '\n Return the inner plethysm between the power-sum symmetric\n function `p_k` and the symmetric function ``g``.\n\n See :meth:`inner_plethysm` for the definition of inner\n plethysm.\n\n .. WARNING::\n\n The function ``g`` *must* be given in the power-sum\n basis for this method to return a correct result.\n\n ALGORITHM:\n\n Express ``g`` in the power sum basis as\n `g = \\sum_\\mu c_\\mu p_\\mu/z_\\mu`\n (where `z_\\mu` is the size of the centralizer of any\n permutation with cycle type `\\mu`). Then, the inner plethysm\n is calculated as\n\n .. MATH::\n\n p_k \\{ g \\} = \\sum_\\mu c_\\mu p_k \\{ p_\\mu/z_\\mu \\}~.\n\n The inner plethysm `p_k \\{ p_mu/z_\\mu \\}` is given by the formula\n\n .. MATH::\n\n p_k \\{ p_\\mu/z_\\mu \\} = \\sum_{\\nu : \\nu^k = \\mu } p_{\\nu}/z_{\\nu}~,\n\n where `\\nu^k` is the `k`-th power of `nu` (see\n :~sage.combinat.partition.partition_power`).\n\n .. SEEALSO:: :func:`~sage.combinat.partition.partition_power`,\n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm`\n\n INPUT:\n\n - ``k`` -- a positive integer\n\n - ``g`` -- a symmetric function in the power sum basis\n\n - ``cache`` -- a dictionary whose keys are (k, g) pairs\n and values are the cached output of this function\n\n EXAMPLES::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: p._inner_plethysm_pk_g(2, p([1,1,1]), {})\n p[1, 1, 1] + 3*p[2, 1]\n sage: p._inner_plethysm_pk_g(5, p([2,2,1,1,1]), {})\n p[2, 2, 1, 1, 1]\n ' try: return cache[(k, g)] except KeyError: pass p = self.realization_of().p() res = 0 degrees = uniq([sum(m) for m in g.support()]) for d in degrees: for mu in sage.combinat.partition.Partitions(d): mu_k = mu.power(k) if (mu_k in g): res += (((g.coefficient(mu_k) * mu_k.centralizer_size()) / mu.centralizer_size()) * p(mu)) cache[(k, g)] = res return res
def _inner_plethysm_pk_g(self, k, g, cache): '\n Return the inner plethysm between the power-sum symmetric\n function `p_k` and the symmetric function ``g``.\n\n See :meth:`inner_plethysm` for the definition of inner\n plethysm.\n\n .. WARNING::\n\n The function ``g`` *must* be given in the power-sum\n basis for this method to return a correct result.\n\n ALGORITHM:\n\n Express ``g`` in the power sum basis as\n `g = \\sum_\\mu c_\\mu p_\\mu/z_\\mu`\n (where `z_\\mu` is the size of the centralizer of any\n permutation with cycle type `\\mu`). Then, the inner plethysm\n is calculated as\n\n .. MATH::\n\n p_k \\{ g \\} = \\sum_\\mu c_\\mu p_k \\{ p_\\mu/z_\\mu \\}~.\n\n The inner plethysm `p_k \\{ p_mu/z_\\mu \\}` is given by the formula\n\n .. MATH::\n\n p_k \\{ p_\\mu/z_\\mu \\} = \\sum_{\\nu : \\nu^k = \\mu } p_{\\nu}/z_{\\nu}~,\n\n where `\\nu^k` is the `k`-th power of `nu` (see\n :~sage.combinat.partition.partition_power`).\n\n .. SEEALSO:: :func:`~sage.combinat.partition.partition_power`,\n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm`\n\n INPUT:\n\n - ``k`` -- a positive integer\n\n - ``g`` -- a symmetric function in the power sum basis\n\n - ``cache`` -- a dictionary whose keys are (k, g) pairs\n and values are the cached output of this function\n\n EXAMPLES::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: p._inner_plethysm_pk_g(2, p([1,1,1]), {})\n p[1, 1, 1] + 3*p[2, 1]\n sage: p._inner_plethysm_pk_g(5, p([2,2,1,1,1]), {})\n p[2, 2, 1, 1, 1]\n ' try: return cache[(k, g)] except KeyError: pass p = self.realization_of().p() res = 0 degrees = uniq([sum(m) for m in g.support()]) for d in degrees: for mu in sage.combinat.partition.Partitions(d): mu_k = mu.power(k) if (mu_k in g): res += (((g.coefficient(mu_k) * mu_k.centralizer_size()) / mu.centralizer_size()) * p(mu)) cache[(k, g)] = res return res<|docstring|>Return the inner plethysm between the power-sum symmetric function `p_k` and the symmetric function ``g``. See :meth:`inner_plethysm` for the definition of inner plethysm. .. WARNING:: The function ``g`` *must* be given in the power-sum basis for this method to return a correct result. ALGORITHM: Express ``g`` in the power sum basis as `g = \sum_\mu c_\mu p_\mu/z_\mu` (where `z_\mu` is the size of the centralizer of any permutation with cycle type `\mu`). Then, the inner plethysm is calculated as .. MATH:: p_k \{ g \} = \sum_\mu c_\mu p_k \{ p_\mu/z_\mu \}~. The inner plethysm `p_k \{ p_mu/z_\mu \}` is given by the formula .. MATH:: p_k \{ p_\mu/z_\mu \} = \sum_{\nu : \nu^k = \mu } p_{\nu}/z_{\nu}~, where `\nu^k` is the `k`-th power of `nu` (see :~sage.combinat.partition.partition_power`). .. SEEALSO:: :func:`~sage.combinat.partition.partition_power`, :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm` INPUT: - ``k`` -- a positive integer - ``g`` -- a symmetric function in the power sum basis - ``cache`` -- a dictionary whose keys are (k, g) pairs and values are the cached output of this function EXAMPLES:: sage: p = SymmetricFunctions(QQ).p() sage: p._inner_plethysm_pk_g(2, p([1,1,1]), {}) p[1, 1, 1] + 3*p[2, 1] sage: p._inner_plethysm_pk_g(5, p([2,2,1,1,1]), {}) p[2, 2, 1, 1, 1]<|endoftext|>
34df7963a90079e476cc42c88648b1f634aa3ac1feaa10ac64a87a68f9da235a
def _inner_plethysm_pnu_g(self, p_x, cache, nu): '\n Return the inner plethysm of the power-sum symmetric function\n `p_\\nu` with another symmetric function ``p_x`` in the\n power-sum basis.\n\n See :meth:`inner_plethysm` for the definition of inner\n plethysm.\n\n .. WARNING::\n\n The function ``p_x`` *must* be given in the power-sum\n basis for this method to return a correct result.\n\n The computation uses the inner plethysm of `p_k` and ``p_x``\n and the identity\n\n .. MATH::\n\n (f \\cdot g) \\{ h \\} = (f \\{ h \\}) \\ast (g \\{ h \\})~.\n\n .. SEEALSO:: :meth:`_inner_plethysm_pk_g`, \n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.itensor`,\n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm`\n\n INPUT:\n\n - ``p_x`` -- a symmetric function in the power sum basis\n\n - ``cache`` -- a cache function\n\n - ``nu`` -- a partition\n\n Note that the order of the arguments is somewhat strange in order\n to facilitate partial function application.\n\n OUTPUT:\n\n - an element of the basis ``self``\n\n EXAMPLES::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: s = SymmetricFunctions(QQ).s()\n sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([2,1]))\n 6*p[1, 1, 1]\n sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([]))\n 1/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3]\n sage: s(_)\n s[3]\n ' if (len(nu) == 0): s = self.realization_of().s() degrees = [part.size() for part in p_x.support()] degrees = uniq(degrees) if (0 in degrees): ext = self([]) else: ext = 0 return (ext + self(sum([s([n]) for n in degrees if (n != 0)]))) res = [self._inner_plethysm_pk_g(k, p_x, cache) for k in nu] return self(reduce((lambda x, y: (0 if (x == 0) else x.itensor(y))), res))
Return the inner plethysm of the power-sum symmetric function `p_\nu` with another symmetric function ``p_x`` in the power-sum basis. See :meth:`inner_plethysm` for the definition of inner plethysm. .. WARNING:: The function ``p_x`` *must* be given in the power-sum basis for this method to return a correct result. The computation uses the inner plethysm of `p_k` and ``p_x`` and the identity .. MATH:: (f \cdot g) \{ h \} = (f \{ h \}) \ast (g \{ h \})~. .. SEEALSO:: :meth:`_inner_plethysm_pk_g`, :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.itensor`, :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm` INPUT: - ``p_x`` -- a symmetric function in the power sum basis - ``cache`` -- a cache function - ``nu`` -- a partition Note that the order of the arguments is somewhat strange in order to facilitate partial function application. OUTPUT: - an element of the basis ``self`` EXAMPLES:: sage: p = SymmetricFunctions(QQ).p() sage: s = SymmetricFunctions(QQ).s() sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([2,1])) 6*p[1, 1, 1] sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([])) 1/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3] sage: s(_) s[3]
src/sage/combinat/sf/sfa.py
_inner_plethysm_pnu_g
bopopescu/sagesmc
5
python
def _inner_plethysm_pnu_g(self, p_x, cache, nu): '\n Return the inner plethysm of the power-sum symmetric function\n `p_\\nu` with another symmetric function ``p_x`` in the\n power-sum basis.\n\n See :meth:`inner_plethysm` for the definition of inner\n plethysm.\n\n .. WARNING::\n\n The function ``p_x`` *must* be given in the power-sum\n basis for this method to return a correct result.\n\n The computation uses the inner plethysm of `p_k` and ``p_x``\n and the identity\n\n .. MATH::\n\n (f \\cdot g) \\{ h \\} = (f \\{ h \\}) \\ast (g \\{ h \\})~.\n\n .. SEEALSO:: :meth:`_inner_plethysm_pk_g`, \n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.itensor`,\n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm`\n\n INPUT:\n\n - ``p_x`` -- a symmetric function in the power sum basis\n\n - ``cache`` -- a cache function\n\n - ``nu`` -- a partition\n\n Note that the order of the arguments is somewhat strange in order\n to facilitate partial function application.\n\n OUTPUT:\n\n - an element of the basis ``self``\n\n EXAMPLES::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: s = SymmetricFunctions(QQ).s()\n sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([2,1]))\n 6*p[1, 1, 1]\n sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([]))\n 1/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3]\n sage: s(_)\n s[3]\n ' if (len(nu) == 0): s = self.realization_of().s() degrees = [part.size() for part in p_x.support()] degrees = uniq(degrees) if (0 in degrees): ext = self([]) else: ext = 0 return (ext + self(sum([s([n]) for n in degrees if (n != 0)]))) res = [self._inner_plethysm_pk_g(k, p_x, cache) for k in nu] return self(reduce((lambda x, y: (0 if (x == 0) else x.itensor(y))), res))
def _inner_plethysm_pnu_g(self, p_x, cache, nu): '\n Return the inner plethysm of the power-sum symmetric function\n `p_\\nu` with another symmetric function ``p_x`` in the\n power-sum basis.\n\n See :meth:`inner_plethysm` for the definition of inner\n plethysm.\n\n .. WARNING::\n\n The function ``p_x`` *must* be given in the power-sum\n basis for this method to return a correct result.\n\n The computation uses the inner plethysm of `p_k` and ``p_x``\n and the identity\n\n .. MATH::\n\n (f \\cdot g) \\{ h \\} = (f \\{ h \\}) \\ast (g \\{ h \\})~.\n\n .. SEEALSO:: :meth:`_inner_plethysm_pk_g`, \n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.itensor`,\n :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm`\n\n INPUT:\n\n - ``p_x`` -- a symmetric function in the power sum basis\n\n - ``cache`` -- a cache function\n\n - ``nu`` -- a partition\n\n Note that the order of the arguments is somewhat strange in order\n to facilitate partial function application.\n\n OUTPUT:\n\n - an element of the basis ``self``\n\n EXAMPLES::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: s = SymmetricFunctions(QQ).s()\n sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([2,1]))\n 6*p[1, 1, 1]\n sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([]))\n 1/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3]\n sage: s(_)\n s[3]\n ' if (len(nu) == 0): s = self.realization_of().s() degrees = [part.size() for part in p_x.support()] degrees = uniq(degrees) if (0 in degrees): ext = self([]) else: ext = 0 return (ext + self(sum([s([n]) for n in degrees if (n != 0)]))) res = [self._inner_plethysm_pk_g(k, p_x, cache) for k in nu] return self(reduce((lambda x, y: (0 if (x == 0) else x.itensor(y))), res))<|docstring|>Return the inner plethysm of the power-sum symmetric function `p_\nu` with another symmetric function ``p_x`` in the power-sum basis. See :meth:`inner_plethysm` for the definition of inner plethysm. .. WARNING:: The function ``p_x`` *must* be given in the power-sum basis for this method to return a correct result. The computation uses the inner plethysm of `p_k` and ``p_x`` and the identity .. MATH:: (f \cdot g) \{ h \} = (f \{ h \}) \ast (g \{ h \})~. .. SEEALSO:: :meth:`_inner_plethysm_pk_g`, :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.itensor`, :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.inner_plethysm` INPUT: - ``p_x`` -- a symmetric function in the power sum basis - ``cache`` -- a cache function - ``nu`` -- a partition Note that the order of the arguments is somewhat strange in order to facilitate partial function application. OUTPUT: - an element of the basis ``self`` EXAMPLES:: sage: p = SymmetricFunctions(QQ).p() sage: s = SymmetricFunctions(QQ).s() sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([2,1])) 6*p[1, 1, 1] sage: p._inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([])) 1/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3] sage: s(_) s[3]<|endoftext|>
6c2f099336f25f8accdbd4806200eac996b16a7b147ed879f7220aa3d03e66ad
def _dual_basis_default(self): '\n Returns the default value for ``self.dual_basis()``\n\n .. SEEALSO:: :meth:`dual_basis`\n\n EXAMPLES:\n\n This default implementation constructs the dual basis using\n the standard (Hall) scalar product::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: Sym.p()._dual_basis_default()\n Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product\n\n This is meant to be overriden by subclasses for which an\n explicit dual basis is known::\n\n sage: Sym.s()._dual_basis_default()\n Symmetric Functions over Rational Field in the Schur basis\n sage: Sym.h()._dual_basis_default()\n Symmetric Functions over Rational Field in the monomial basis\n sage: Sym.m()._dual_basis_default()\n Symmetric Functions over Rational Field in the homogeneous basis\n sage: Sym.f()._dual_basis_default()\n Symmetric Functions over Rational Field in the elementary basis\n sage: Sym.e()._dual_basis_default()\n Symmetric Functions over Rational Field in the forgotten basis\n sage: Sym.f()._dual_basis_default()\n Symmetric Functions over Rational Field in the elementary basis\n ' return self.dual_basis(scalar=zee, scalar_name='Hall scalar product')
Returns the default value for ``self.dual_basis()`` .. SEEALSO:: :meth:`dual_basis` EXAMPLES: This default implementation constructs the dual basis using the standard (Hall) scalar product:: sage: Sym = SymmetricFunctions(QQ) sage: Sym.p()._dual_basis_default() Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product This is meant to be overriden by subclasses for which an explicit dual basis is known:: sage: Sym.s()._dual_basis_default() Symmetric Functions over Rational Field in the Schur basis sage: Sym.h()._dual_basis_default() Symmetric Functions over Rational Field in the monomial basis sage: Sym.m()._dual_basis_default() Symmetric Functions over Rational Field in the homogeneous basis sage: Sym.f()._dual_basis_default() Symmetric Functions over Rational Field in the elementary basis sage: Sym.e()._dual_basis_default() Symmetric Functions over Rational Field in the forgotten basis sage: Sym.f()._dual_basis_default() Symmetric Functions over Rational Field in the elementary basis
src/sage/combinat/sf/sfa.py
_dual_basis_default
bopopescu/sagesmc
5
python
def _dual_basis_default(self): '\n Returns the default value for ``self.dual_basis()``\n\n .. SEEALSO:: :meth:`dual_basis`\n\n EXAMPLES:\n\n This default implementation constructs the dual basis using\n the standard (Hall) scalar product::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: Sym.p()._dual_basis_default()\n Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product\n\n This is meant to be overriden by subclasses for which an\n explicit dual basis is known::\n\n sage: Sym.s()._dual_basis_default()\n Symmetric Functions over Rational Field in the Schur basis\n sage: Sym.h()._dual_basis_default()\n Symmetric Functions over Rational Field in the monomial basis\n sage: Sym.m()._dual_basis_default()\n Symmetric Functions over Rational Field in the homogeneous basis\n sage: Sym.f()._dual_basis_default()\n Symmetric Functions over Rational Field in the elementary basis\n sage: Sym.e()._dual_basis_default()\n Symmetric Functions over Rational Field in the forgotten basis\n sage: Sym.f()._dual_basis_default()\n Symmetric Functions over Rational Field in the elementary basis\n ' return self.dual_basis(scalar=zee, scalar_name='Hall scalar product')
def _dual_basis_default(self): '\n Returns the default value for ``self.dual_basis()``\n\n .. SEEALSO:: :meth:`dual_basis`\n\n EXAMPLES:\n\n This default implementation constructs the dual basis using\n the standard (Hall) scalar product::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: Sym.p()._dual_basis_default()\n Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product\n\n This is meant to be overriden by subclasses for which an\n explicit dual basis is known::\n\n sage: Sym.s()._dual_basis_default()\n Symmetric Functions over Rational Field in the Schur basis\n sage: Sym.h()._dual_basis_default()\n Symmetric Functions over Rational Field in the monomial basis\n sage: Sym.m()._dual_basis_default()\n Symmetric Functions over Rational Field in the homogeneous basis\n sage: Sym.f()._dual_basis_default()\n Symmetric Functions over Rational Field in the elementary basis\n sage: Sym.e()._dual_basis_default()\n Symmetric Functions over Rational Field in the forgotten basis\n sage: Sym.f()._dual_basis_default()\n Symmetric Functions over Rational Field in the elementary basis\n ' return self.dual_basis(scalar=zee, scalar_name='Hall scalar product')<|docstring|>Returns the default value for ``self.dual_basis()`` .. SEEALSO:: :meth:`dual_basis` EXAMPLES: This default implementation constructs the dual basis using the standard (Hall) scalar product:: sage: Sym = SymmetricFunctions(QQ) sage: Sym.p()._dual_basis_default() Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product This is meant to be overriden by subclasses for which an explicit dual basis is known:: sage: Sym.s()._dual_basis_default() Symmetric Functions over Rational Field in the Schur basis sage: Sym.h()._dual_basis_default() Symmetric Functions over Rational Field in the monomial basis sage: Sym.m()._dual_basis_default() Symmetric Functions over Rational Field in the homogeneous basis sage: Sym.f()._dual_basis_default() Symmetric Functions over Rational Field in the elementary basis sage: Sym.e()._dual_basis_default() Symmetric Functions over Rational Field in the forgotten basis sage: Sym.f()._dual_basis_default() Symmetric Functions over Rational Field in the elementary basis<|endoftext|>
37e2ca44bdfcd31a1ba5589651dae4320b535b1968d068eb5e3bdb9d3de56ba3
def dual_basis(self, scalar=None, scalar_name='', basis_name=None, prefix=None): "\n Return the dual basis of ``self`` with respect to the scalar\n product ``scalar``.\n\n INPUT:\n\n - ``scalar`` -- A function ``zee`` from partitions to the base ring\n which specifies the scalar product by `\\langle p_{\\lambda},\n p_{\\lambda} \\rangle = \\mathrm{zee}(\\lambda)`. (Independently on the\n function chosen, the power sum basis will always be orthogonal;\n the function ``scalar`` only determines the norms of the basis\n elements.) If ``scalar`` is None, then the standard (Hall) scalar\n product is used.\n - ``scalar_name`` -- name of the scalar function\n - ``prefix`` -- prefix used to display the basis\n\n EXAMPLES:\n\n The duals of the elementary symmetric functions with respect to the\n Hall scalar product are the forgotten symmetric functions.\n\n ::\n\n sage: e = SymmetricFunctions(QQ).e()\n sage: f = e.dual_basis(prefix='f'); f\n Dual basis to Symmetric Functions over Rational Field in the elementary basis with respect to the Hall scalar product\n sage: f([2,1])^2\n 4*f[2, 2, 1, 1] + 6*f[2, 2, 2] + 2*f[3, 2, 1] + 2*f[3, 3] + 2*f[4, 1, 1] + f[4, 2]\n sage: f([2,1]).scalar(e([2,1]))\n 1\n sage: f([2,1]).scalar(e([1,1,1]))\n 0\n\n Since the power-sum symmetric functions are orthogonal, their duals\n with respect to the Hall scalar product are scalar multiples of\n themselves.\n\n ::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: q = p.dual_basis(prefix='q'); q\n Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product\n sage: q([2,1])^2\n 4*q[2, 2, 1, 1]\n sage: p([2,1]).scalar(q([2,1]))\n 1\n sage: p([2,1]).scalar(q([1,1,1]))\n 0\n " import dual if (scalar is None): if ((basis_name is None) and (prefix is None)): return self._dual_basis_default() scalar = zee scalar_name = 'Hall scalar product' return dual.SymmetricFunctionAlgebra_dual(self, scalar, scalar_name, basis_name=basis_name, prefix=prefix)
Return the dual basis of ``self`` with respect to the scalar product ``scalar``. INPUT: - ``scalar`` -- A function ``zee`` from partitions to the base ring which specifies the scalar product by `\langle p_{\lambda}, p_{\lambda} \rangle = \mathrm{zee}(\lambda)`. (Independently on the function chosen, the power sum basis will always be orthogonal; the function ``scalar`` only determines the norms of the basis elements.) If ``scalar`` is None, then the standard (Hall) scalar product is used. - ``scalar_name`` -- name of the scalar function - ``prefix`` -- prefix used to display the basis EXAMPLES: The duals of the elementary symmetric functions with respect to the Hall scalar product are the forgotten symmetric functions. :: sage: e = SymmetricFunctions(QQ).e() sage: f = e.dual_basis(prefix='f'); f Dual basis to Symmetric Functions over Rational Field in the elementary basis with respect to the Hall scalar product sage: f([2,1])^2 4*f[2, 2, 1, 1] + 6*f[2, 2, 2] + 2*f[3, 2, 1] + 2*f[3, 3] + 2*f[4, 1, 1] + f[4, 2] sage: f([2,1]).scalar(e([2,1])) 1 sage: f([2,1]).scalar(e([1,1,1])) 0 Since the power-sum symmetric functions are orthogonal, their duals with respect to the Hall scalar product are scalar multiples of themselves. :: sage: p = SymmetricFunctions(QQ).p() sage: q = p.dual_basis(prefix='q'); q Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product sage: q([2,1])^2 4*q[2, 2, 1, 1] sage: p([2,1]).scalar(q([2,1])) 1 sage: p([2,1]).scalar(q([1,1,1])) 0
src/sage/combinat/sf/sfa.py
dual_basis
bopopescu/sagesmc
5
python
def dual_basis(self, scalar=None, scalar_name=, basis_name=None, prefix=None): "\n Return the dual basis of ``self`` with respect to the scalar\n product ``scalar``.\n\n INPUT:\n\n - ``scalar`` -- A function ``zee`` from partitions to the base ring\n which specifies the scalar product by `\\langle p_{\\lambda},\n p_{\\lambda} \\rangle = \\mathrm{zee}(\\lambda)`. (Independently on the\n function chosen, the power sum basis will always be orthogonal;\n the function ``scalar`` only determines the norms of the basis\n elements.) If ``scalar`` is None, then the standard (Hall) scalar\n product is used.\n - ``scalar_name`` -- name of the scalar function\n - ``prefix`` -- prefix used to display the basis\n\n EXAMPLES:\n\n The duals of the elementary symmetric functions with respect to the\n Hall scalar product are the forgotten symmetric functions.\n\n ::\n\n sage: e = SymmetricFunctions(QQ).e()\n sage: f = e.dual_basis(prefix='f'); f\n Dual basis to Symmetric Functions over Rational Field in the elementary basis with respect to the Hall scalar product\n sage: f([2,1])^2\n 4*f[2, 2, 1, 1] + 6*f[2, 2, 2] + 2*f[3, 2, 1] + 2*f[3, 3] + 2*f[4, 1, 1] + f[4, 2]\n sage: f([2,1]).scalar(e([2,1]))\n 1\n sage: f([2,1]).scalar(e([1,1,1]))\n 0\n\n Since the power-sum symmetric functions are orthogonal, their duals\n with respect to the Hall scalar product are scalar multiples of\n themselves.\n\n ::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: q = p.dual_basis(prefix='q'); q\n Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product\n sage: q([2,1])^2\n 4*q[2, 2, 1, 1]\n sage: p([2,1]).scalar(q([2,1]))\n 1\n sage: p([2,1]).scalar(q([1,1,1]))\n 0\n " import dual if (scalar is None): if ((basis_name is None) and (prefix is None)): return self._dual_basis_default() scalar = zee scalar_name = 'Hall scalar product' return dual.SymmetricFunctionAlgebra_dual(self, scalar, scalar_name, basis_name=basis_name, prefix=prefix)
def dual_basis(self, scalar=None, scalar_name=, basis_name=None, prefix=None): "\n Return the dual basis of ``self`` with respect to the scalar\n product ``scalar``.\n\n INPUT:\n\n - ``scalar`` -- A function ``zee`` from partitions to the base ring\n which specifies the scalar product by `\\langle p_{\\lambda},\n p_{\\lambda} \\rangle = \\mathrm{zee}(\\lambda)`. (Independently on the\n function chosen, the power sum basis will always be orthogonal;\n the function ``scalar`` only determines the norms of the basis\n elements.) If ``scalar`` is None, then the standard (Hall) scalar\n product is used.\n - ``scalar_name`` -- name of the scalar function\n - ``prefix`` -- prefix used to display the basis\n\n EXAMPLES:\n\n The duals of the elementary symmetric functions with respect to the\n Hall scalar product are the forgotten symmetric functions.\n\n ::\n\n sage: e = SymmetricFunctions(QQ).e()\n sage: f = e.dual_basis(prefix='f'); f\n Dual basis to Symmetric Functions over Rational Field in the elementary basis with respect to the Hall scalar product\n sage: f([2,1])^2\n 4*f[2, 2, 1, 1] + 6*f[2, 2, 2] + 2*f[3, 2, 1] + 2*f[3, 3] + 2*f[4, 1, 1] + f[4, 2]\n sage: f([2,1]).scalar(e([2,1]))\n 1\n sage: f([2,1]).scalar(e([1,1,1]))\n 0\n\n Since the power-sum symmetric functions are orthogonal, their duals\n with respect to the Hall scalar product are scalar multiples of\n themselves.\n\n ::\n\n sage: p = SymmetricFunctions(QQ).p()\n sage: q = p.dual_basis(prefix='q'); q\n Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product\n sage: q([2,1])^2\n 4*q[2, 2, 1, 1]\n sage: p([2,1]).scalar(q([2,1]))\n 1\n sage: p([2,1]).scalar(q([1,1,1]))\n 0\n " import dual if (scalar is None): if ((basis_name is None) and (prefix is None)): return self._dual_basis_default() scalar = zee scalar_name = 'Hall scalar product' return dual.SymmetricFunctionAlgebra_dual(self, scalar, scalar_name, basis_name=basis_name, prefix=prefix)<|docstring|>Return the dual basis of ``self`` with respect to the scalar product ``scalar``. INPUT: - ``scalar`` -- A function ``zee`` from partitions to the base ring which specifies the scalar product by `\langle p_{\lambda}, p_{\lambda} \rangle = \mathrm{zee}(\lambda)`. (Independently on the function chosen, the power sum basis will always be orthogonal; the function ``scalar`` only determines the norms of the basis elements.) If ``scalar`` is None, then the standard (Hall) scalar product is used. - ``scalar_name`` -- name of the scalar function - ``prefix`` -- prefix used to display the basis EXAMPLES: The duals of the elementary symmetric functions with respect to the Hall scalar product are the forgotten symmetric functions. :: sage: e = SymmetricFunctions(QQ).e() sage: f = e.dual_basis(prefix='f'); f Dual basis to Symmetric Functions over Rational Field in the elementary basis with respect to the Hall scalar product sage: f([2,1])^2 4*f[2, 2, 1, 1] + 6*f[2, 2, 2] + 2*f[3, 2, 1] + 2*f[3, 3] + 2*f[4, 1, 1] + f[4, 2] sage: f([2,1]).scalar(e([2,1])) 1 sage: f([2,1]).scalar(e([1,1,1])) 0 Since the power-sum symmetric functions are orthogonal, their duals with respect to the Hall scalar product are scalar multiples of themselves. :: sage: p = SymmetricFunctions(QQ).p() sage: q = p.dual_basis(prefix='q'); q Dual basis to Symmetric Functions over Rational Field in the powersum basis with respect to the Hall scalar product sage: q([2,1])^2 4*q[2, 2, 1, 1] sage: p([2,1]).scalar(q([2,1])) 1 sage: p([2,1]).scalar(q([1,1,1])) 0<|endoftext|>
c87298bbb07b02e31aaf84b9cdeb3e4cb5fd520fbe2ed0ab35a653ce15001eea
def basis_name(self): "\n Return the name of the basis of ``self``.\n\n This is used for output and, for the classical bases of\n symmetric functions, to connect this basis with Symmetrica.\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.s()\n sage: s.basis_name()\n 'Schur'\n sage: p = Sym.p()\n sage: p.basis_name()\n 'powersum'\n sage: h = Sym.h()\n sage: h.basis_name()\n 'homogeneous'\n sage: e = Sym.e()\n sage: e.basis_name()\n 'elementary'\n sage: m = Sym.m()\n sage: m.basis_name()\n 'monomial'\n sage: f = Sym.f()\n sage: f.basis_name()\n 'forgotten'\n " return self._basis
Return the name of the basis of ``self``. This is used for output and, for the classical bases of symmetric functions, to connect this basis with Symmetrica. EXAMPLES:: sage: Sym = SymmetricFunctions(QQ) sage: s = Sym.s() sage: s.basis_name() 'Schur' sage: p = Sym.p() sage: p.basis_name() 'powersum' sage: h = Sym.h() sage: h.basis_name() 'homogeneous' sage: e = Sym.e() sage: e.basis_name() 'elementary' sage: m = Sym.m() sage: m.basis_name() 'monomial' sage: f = Sym.f() sage: f.basis_name() 'forgotten'
src/sage/combinat/sf/sfa.py
basis_name
bopopescu/sagesmc
5
python
def basis_name(self): "\n Return the name of the basis of ``self``.\n\n This is used for output and, for the classical bases of\n symmetric functions, to connect this basis with Symmetrica.\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.s()\n sage: s.basis_name()\n 'Schur'\n sage: p = Sym.p()\n sage: p.basis_name()\n 'powersum'\n sage: h = Sym.h()\n sage: h.basis_name()\n 'homogeneous'\n sage: e = Sym.e()\n sage: e.basis_name()\n 'elementary'\n sage: m = Sym.m()\n sage: m.basis_name()\n 'monomial'\n sage: f = Sym.f()\n sage: f.basis_name()\n 'forgotten'\n " return self._basis
def basis_name(self): "\n Return the name of the basis of ``self``.\n\n This is used for output and, for the classical bases of\n symmetric functions, to connect this basis with Symmetrica.\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.s()\n sage: s.basis_name()\n 'Schur'\n sage: p = Sym.p()\n sage: p.basis_name()\n 'powersum'\n sage: h = Sym.h()\n sage: h.basis_name()\n 'homogeneous'\n sage: e = Sym.e()\n sage: e.basis_name()\n 'elementary'\n sage: m = Sym.m()\n sage: m.basis_name()\n 'monomial'\n sage: f = Sym.f()\n sage: f.basis_name()\n 'forgotten'\n " return self._basis<|docstring|>Return the name of the basis of ``self``. This is used for output and, for the classical bases of symmetric functions, to connect this basis with Symmetrica. EXAMPLES:: sage: Sym = SymmetricFunctions(QQ) sage: s = Sym.s() sage: s.basis_name() 'Schur' sage: p = Sym.p() sage: p.basis_name() 'powersum' sage: h = Sym.h() sage: h.basis_name() 'homogeneous' sage: e = Sym.e() sage: e.basis_name() 'elementary' sage: m = Sym.m() sage: m.basis_name() 'monomial' sage: f = Sym.f() sage: f.basis_name() 'forgotten'<|endoftext|>
9026b4db0ddd47efa022da7e6762efaa9c3c9d87bc71b3d161c4387adddf4969
def get_print_style(self): "\n Return the value of the current print style for ``self``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s.get_print_style()\n 'lex'\n sage: s.set_print_style('length')\n sage: s.get_print_style()\n 'length'\n sage: s.set_print_style('lex')\n " return self._print_style
Return the value of the current print style for ``self``. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: s.get_print_style() 'lex' sage: s.set_print_style('length') sage: s.get_print_style() 'length' sage: s.set_print_style('lex')
src/sage/combinat/sf/sfa.py
get_print_style
bopopescu/sagesmc
5
python
def get_print_style(self): "\n Return the value of the current print style for ``self``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s.get_print_style()\n 'lex'\n sage: s.set_print_style('length')\n sage: s.get_print_style()\n 'length'\n sage: s.set_print_style('lex')\n " return self._print_style
def get_print_style(self): "\n Return the value of the current print style for ``self``.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s.get_print_style()\n 'lex'\n sage: s.set_print_style('length')\n sage: s.get_print_style()\n 'length'\n sage: s.set_print_style('lex')\n " return self._print_style<|docstring|>Return the value of the current print style for ``self``. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: s.get_print_style() 'lex' sage: s.set_print_style('length') sage: s.get_print_style() 'length' sage: s.set_print_style('lex')<|endoftext|>
d8df14daa008c4667e786254ca5f7e91d1dc72e86709e3b0454c551a92927c54
def set_print_style(self, ps): "\n Set the value of the current print style to ``ps``.\n\n INPUT:\n\n - ``ps`` -- a string specifying the printing style\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s.get_print_style()\n 'lex'\n sage: s.set_print_style('length')\n sage: s.get_print_style()\n 'length'\n sage: s.set_print_style('lex')\n " if (ps == 'lex'): self.print_options(monomial_cmp=(lambda x, y: cmp(x, y))) elif (ps == 'length'): self.print_options(monomial_cmp=(lambda x, y: cmp(len(x), len(y)))) elif (ps == 'maximal_part'): self.print_options(monomial_cmp=(lambda x, y: cmp(_lmax(x), _lmax(y)))) else: raise ValueError('the print style must be one of lex, length, or maximal_part ') self._print_style = ps
Set the value of the current print style to ``ps``. INPUT: - ``ps`` -- a string specifying the printing style EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: s.get_print_style() 'lex' sage: s.set_print_style('length') sage: s.get_print_style() 'length' sage: s.set_print_style('lex')
src/sage/combinat/sf/sfa.py
set_print_style
bopopescu/sagesmc
5
python
def set_print_style(self, ps): "\n Set the value of the current print style to ``ps``.\n\n INPUT:\n\n - ``ps`` -- a string specifying the printing style\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s.get_print_style()\n 'lex'\n sage: s.set_print_style('length')\n sage: s.get_print_style()\n 'length'\n sage: s.set_print_style('lex')\n " if (ps == 'lex'): self.print_options(monomial_cmp=(lambda x, y: cmp(x, y))) elif (ps == 'length'): self.print_options(monomial_cmp=(lambda x, y: cmp(len(x), len(y)))) elif (ps == 'maximal_part'): self.print_options(monomial_cmp=(lambda x, y: cmp(_lmax(x), _lmax(y)))) else: raise ValueError('the print style must be one of lex, length, or maximal_part ') self._print_style = ps
def set_print_style(self, ps): "\n Set the value of the current print style to ``ps``.\n\n INPUT:\n\n - ``ps`` -- a string specifying the printing style\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s.get_print_style()\n 'lex'\n sage: s.set_print_style('length')\n sage: s.get_print_style()\n 'length'\n sage: s.set_print_style('lex')\n " if (ps == 'lex'): self.print_options(monomial_cmp=(lambda x, y: cmp(x, y))) elif (ps == 'length'): self.print_options(monomial_cmp=(lambda x, y: cmp(len(x), len(y)))) elif (ps == 'maximal_part'): self.print_options(monomial_cmp=(lambda x, y: cmp(_lmax(x), _lmax(y)))) else: raise ValueError('the print style must be one of lex, length, or maximal_part ') self._print_style = ps<|docstring|>Set the value of the current print style to ``ps``. INPUT: - ``ps`` -- a string specifying the printing style EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: s.get_print_style() 'lex' sage: s.set_print_style('length') sage: s.get_print_style() 'length' sage: s.set_print_style('lex')<|endoftext|>
b2146b7041f5e6d5ec575d88854ba9b3c74a031a98a7e528be9ccd6be15f31eb
def _latex_term(self, m): "\n Latex terms (i.e. partitions) as plain lists (and not as\n ferrers diagrams).\n\n INPUT:\n\n - ``m`` -- a partition or list\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: m._latex_term(Partition([3,2,1]))\n 'm_{3,2,1}'\n sage: f = sum([m(p) for p in Partitions(3)])\n sage: m.set_print_style('lex')\n sage: latex(f)\n m_{1,1,1} + m_{2,1} + m_{3}\n sage: m.set_print_style('length')\n sage: latex(f)\n m_{3} + m_{2,1} + m_{1,1,1}\n sage: m.set_print_style('maximal_part')\n sage: latex(f)\n m_{1,1,1} + m_{2,1} + m_{3}\n " return super(SymmetricFunctionAlgebra_generic, self)._latex_term(','.join((str(i) for i in m)))
Latex terms (i.e. partitions) as plain lists (and not as ferrers diagrams). INPUT: - ``m`` -- a partition or list EXAMPLES:: sage: m = SymmetricFunctions(QQ).m() sage: m._latex_term(Partition([3,2,1])) 'm_{3,2,1}' sage: f = sum([m(p) for p in Partitions(3)]) sage: m.set_print_style('lex') sage: latex(f) m_{1,1,1} + m_{2,1} + m_{3} sage: m.set_print_style('length') sage: latex(f) m_{3} + m_{2,1} + m_{1,1,1} sage: m.set_print_style('maximal_part') sage: latex(f) m_{1,1,1} + m_{2,1} + m_{3}
src/sage/combinat/sf/sfa.py
_latex_term
bopopescu/sagesmc
5
python
def _latex_term(self, m): "\n Latex terms (i.e. partitions) as plain lists (and not as\n ferrers diagrams).\n\n INPUT:\n\n - ``m`` -- a partition or list\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: m._latex_term(Partition([3,2,1]))\n 'm_{3,2,1}'\n sage: f = sum([m(p) for p in Partitions(3)])\n sage: m.set_print_style('lex')\n sage: latex(f)\n m_{1,1,1} + m_{2,1} + m_{3}\n sage: m.set_print_style('length')\n sage: latex(f)\n m_{3} + m_{2,1} + m_{1,1,1}\n sage: m.set_print_style('maximal_part')\n sage: latex(f)\n m_{1,1,1} + m_{2,1} + m_{3}\n " return super(SymmetricFunctionAlgebra_generic, self)._latex_term(','.join((str(i) for i in m)))
def _latex_term(self, m): "\n Latex terms (i.e. partitions) as plain lists (and not as\n ferrers diagrams).\n\n INPUT:\n\n - ``m`` -- a partition or list\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: m._latex_term(Partition([3,2,1]))\n 'm_{3,2,1}'\n sage: f = sum([m(p) for p in Partitions(3)])\n sage: m.set_print_style('lex')\n sage: latex(f)\n m_{1,1,1} + m_{2,1} + m_{3}\n sage: m.set_print_style('length')\n sage: latex(f)\n m_{3} + m_{2,1} + m_{1,1,1}\n sage: m.set_print_style('maximal_part')\n sage: latex(f)\n m_{1,1,1} + m_{2,1} + m_{3}\n " return super(SymmetricFunctionAlgebra_generic, self)._latex_term(','.join((str(i) for i in m)))<|docstring|>Latex terms (i.e. partitions) as plain lists (and not as ferrers diagrams). INPUT: - ``m`` -- a partition or list EXAMPLES:: sage: m = SymmetricFunctions(QQ).m() sage: m._latex_term(Partition([3,2,1])) 'm_{3,2,1}' sage: f = sum([m(p) for p in Partitions(3)]) sage: m.set_print_style('lex') sage: latex(f) m_{1,1,1} + m_{2,1} + m_{3} sage: m.set_print_style('length') sage: latex(f) m_{3} + m_{2,1} + m_{1,1,1} sage: m.set_print_style('maximal_part') sage: latex(f) m_{1,1,1} + m_{2,1} + m_{3}<|endoftext|>
8a760f397a206b9d69c3696c8809ee733f275847321b23a63f7cc2ceb22e3cbb
def from_polynomial(self, poly, check=True): '\n Convert polynomial to a symmetric function in the monomial basis\n and then to the basis ``self``.\n\n INPUT:\n\n - ``poly`` -- a symmetric polynomial\n - ``check`` -- (default: ``True``) boolean, specifies whether\n the computation checks that the polynomial is indeed symmetric\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: h = Sym.homogeneous()\n sage: f = (h([]) + h([2,1]) + h([3])).expand(3)\n sage: h.from_polynomial(f)\n h[] + h[2, 1] + h[3]\n sage: s = Sym.s()\n sage: g = (s([]) + s([2,1])).expand(3); g\n x0^2*x1 + x0*x1^2 + x0^2*x2 + 2*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 + 1\n sage: s.from_polynomial(g)\n s[] + s[2, 1]\n ' m = self.realization_of().m() return self(m.from_polynomial(poly, check=check))
Convert polynomial to a symmetric function in the monomial basis and then to the basis ``self``. INPUT: - ``poly`` -- a symmetric polynomial - ``check`` -- (default: ``True``) boolean, specifies whether the computation checks that the polynomial is indeed symmetric EXAMPLES:: sage: Sym = SymmetricFunctions(QQ) sage: h = Sym.homogeneous() sage: f = (h([]) + h([2,1]) + h([3])).expand(3) sage: h.from_polynomial(f) h[] + h[2, 1] + h[3] sage: s = Sym.s() sage: g = (s([]) + s([2,1])).expand(3); g x0^2*x1 + x0*x1^2 + x0^2*x2 + 2*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 + 1 sage: s.from_polynomial(g) s[] + s[2, 1]
src/sage/combinat/sf/sfa.py
from_polynomial
bopopescu/sagesmc
5
python
def from_polynomial(self, poly, check=True): '\n Convert polynomial to a symmetric function in the monomial basis\n and then to the basis ``self``.\n\n INPUT:\n\n - ``poly`` -- a symmetric polynomial\n - ``check`` -- (default: ``True``) boolean, specifies whether\n the computation checks that the polynomial is indeed symmetric\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: h = Sym.homogeneous()\n sage: f = (h([]) + h([2,1]) + h([3])).expand(3)\n sage: h.from_polynomial(f)\n h[] + h[2, 1] + h[3]\n sage: s = Sym.s()\n sage: g = (s([]) + s([2,1])).expand(3); g\n x0^2*x1 + x0*x1^2 + x0^2*x2 + 2*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 + 1\n sage: s.from_polynomial(g)\n s[] + s[2, 1]\n ' m = self.realization_of().m() return self(m.from_polynomial(poly, check=check))
def from_polynomial(self, poly, check=True): '\n Convert polynomial to a symmetric function in the monomial basis\n and then to the basis ``self``.\n\n INPUT:\n\n - ``poly`` -- a symmetric polynomial\n - ``check`` -- (default: ``True``) boolean, specifies whether\n the computation checks that the polynomial is indeed symmetric\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: h = Sym.homogeneous()\n sage: f = (h([]) + h([2,1]) + h([3])).expand(3)\n sage: h.from_polynomial(f)\n h[] + h[2, 1] + h[3]\n sage: s = Sym.s()\n sage: g = (s([]) + s([2,1])).expand(3); g\n x0^2*x1 + x0*x1^2 + x0^2*x2 + 2*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 + 1\n sage: s.from_polynomial(g)\n s[] + s[2, 1]\n ' m = self.realization_of().m() return self(m.from_polynomial(poly, check=check))<|docstring|>Convert polynomial to a symmetric function in the monomial basis and then to the basis ``self``. INPUT: - ``poly`` -- a symmetric polynomial - ``check`` -- (default: ``True``) boolean, specifies whether the computation checks that the polynomial is indeed symmetric EXAMPLES:: sage: Sym = SymmetricFunctions(QQ) sage: h = Sym.homogeneous() sage: f = (h([]) + h([2,1]) + h([3])).expand(3) sage: h.from_polynomial(f) h[] + h[2, 1] + h[3] sage: s = Sym.s() sage: g = (s([]) + s([2,1])).expand(3); g x0^2*x1 + x0*x1^2 + x0^2*x2 + 2*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 + 1 sage: s.from_polynomial(g) s[] + s[2, 1]<|endoftext|>
2443f83a1d1d37af9bf86499257ba6afa250775346a13ddbfc0f203a21809052
def coproduct_by_coercion(self, elt): "\n Return the coproduct of the element ``elt`` by coercion to\n the Schur basis.\n\n INPUT:\n\n - ``elt`` -- an instance of this basis\n\n OUTPUT:\n\n - The coproduct acting on ``elt``, the result is an element of the\n tensor squared of the basis ``self``\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: m[3,1,1].coproduct()\n m[] # m[3, 1, 1] + m[1] # m[3, 1] + m[1, 1] # m[3] + m[3] # m[1, 1] + m[3, 1] # m[1] + m[3, 1, 1] # m[]\n sage: m.coproduct_by_coercion(m[2,1])\n m[] # m[2, 1] + m[1] # m[2] + m[2] # m[1] + m[2, 1] # m[]\n sage: m.coproduct_by_coercion(m[2,1]) == m([2,1]).coproduct()\n True\n sage: McdH = SymmetricFunctions(QQ['q','t'].fraction_field()).macdonald().H()\n sage: McdH[2,1].coproduct()\n McdH[] # McdH[2, 1] + ((q^2*t-1)/(q*t-1))*McdH[1] # McdH[1, 1] + ((q*t^2-1)/(q*t-1))*McdH[1] # McdH[2] + ((q^2*t-1)/(q*t-1))*McdH[1, 1] # McdH[1] + ((q*t^2-1)/(q*t-1))*McdH[2] # McdH[1] + McdH[2, 1] # McdH[]\n sage: HLQp = SymmetricFunctions(QQ['t'].fraction_field()).hall_littlewood().Qp()\n sage: HLQp[2,1].coproduct()\n HLQp[] # HLQp[2, 1] + HLQp[1] # HLQp[1, 1] + HLQp[1] # HLQp[2] + HLQp[1, 1] # HLQp[1] + HLQp[2] # HLQp[1] + HLQp[2, 1] # HLQp[]\n sage: Sym = SymmetricFunctions(FractionField(QQ['t']))\n sage: LLT = Sym.llt(3)\n sage: LLT.cospin([3,2,1]).coproduct()\n (t+1)*m[] # m[1, 1] + m[] # m[2] + (t+1)*m[1] # m[1] + (t+1)*m[1, 1] # m[] + m[2] # m[]\n sage: f = SymmetricFunctions(ZZ).f()\n sage: f[3].coproduct()\n f[] # f[3] + f[3] # f[]\n sage: f[3,2,1].coproduct()\n f[] # f[3, 2, 1] + f[1] # f[3, 2] + f[2] # f[3, 1] + f[2, 1] # f[3] + f[3] # f[2, 1] + f[3, 1] # f[2] + f[3, 2] # f[1] + f[3, 2, 1] # f[]\n " from sage.categories.tensor import tensor s = self.realization_of().schur() return self.tensor_square().sum(((coeff * tensor([self(s[x]), self(s[y])])) for ((x, y), coeff) in s(elt).coproduct()))
Return the coproduct of the element ``elt`` by coercion to the Schur basis. INPUT: - ``elt`` -- an instance of this basis OUTPUT: - The coproduct acting on ``elt``, the result is an element of the tensor squared of the basis ``self`` EXAMPLES:: sage: m = SymmetricFunctions(QQ).m() sage: m[3,1,1].coproduct() m[] # m[3, 1, 1] + m[1] # m[3, 1] + m[1, 1] # m[3] + m[3] # m[1, 1] + m[3, 1] # m[1] + m[3, 1, 1] # m[] sage: m.coproduct_by_coercion(m[2,1]) m[] # m[2, 1] + m[1] # m[2] + m[2] # m[1] + m[2, 1] # m[] sage: m.coproduct_by_coercion(m[2,1]) == m([2,1]).coproduct() True sage: McdH = SymmetricFunctions(QQ['q','t'].fraction_field()).macdonald().H() sage: McdH[2,1].coproduct() McdH[] # McdH[2, 1] + ((q^2*t-1)/(q*t-1))*McdH[1] # McdH[1, 1] + ((q*t^2-1)/(q*t-1))*McdH[1] # McdH[2] + ((q^2*t-1)/(q*t-1))*McdH[1, 1] # McdH[1] + ((q*t^2-1)/(q*t-1))*McdH[2] # McdH[1] + McdH[2, 1] # McdH[] sage: HLQp = SymmetricFunctions(QQ['t'].fraction_field()).hall_littlewood().Qp() sage: HLQp[2,1].coproduct() HLQp[] # HLQp[2, 1] + HLQp[1] # HLQp[1, 1] + HLQp[1] # HLQp[2] + HLQp[1, 1] # HLQp[1] + HLQp[2] # HLQp[1] + HLQp[2, 1] # HLQp[] sage: Sym = SymmetricFunctions(FractionField(QQ['t'])) sage: LLT = Sym.llt(3) sage: LLT.cospin([3,2,1]).coproduct() (t+1)*m[] # m[1, 1] + m[] # m[2] + (t+1)*m[1] # m[1] + (t+1)*m[1, 1] # m[] + m[2] # m[] sage: f = SymmetricFunctions(ZZ).f() sage: f[3].coproduct() f[] # f[3] + f[3] # f[] sage: f[3,2,1].coproduct() f[] # f[3, 2, 1] + f[1] # f[3, 2] + f[2] # f[3, 1] + f[2, 1] # f[3] + f[3] # f[2, 1] + f[3, 1] # f[2] + f[3, 2] # f[1] + f[3, 2, 1] # f[]
src/sage/combinat/sf/sfa.py
coproduct_by_coercion
bopopescu/sagesmc
5
python
def coproduct_by_coercion(self, elt): "\n Return the coproduct of the element ``elt`` by coercion to\n the Schur basis.\n\n INPUT:\n\n - ``elt`` -- an instance of this basis\n\n OUTPUT:\n\n - The coproduct acting on ``elt``, the result is an element of the\n tensor squared of the basis ``self``\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: m[3,1,1].coproduct()\n m[] # m[3, 1, 1] + m[1] # m[3, 1] + m[1, 1] # m[3] + m[3] # m[1, 1] + m[3, 1] # m[1] + m[3, 1, 1] # m[]\n sage: m.coproduct_by_coercion(m[2,1])\n m[] # m[2, 1] + m[1] # m[2] + m[2] # m[1] + m[2, 1] # m[]\n sage: m.coproduct_by_coercion(m[2,1]) == m([2,1]).coproduct()\n True\n sage: McdH = SymmetricFunctions(QQ['q','t'].fraction_field()).macdonald().H()\n sage: McdH[2,1].coproduct()\n McdH[] # McdH[2, 1] + ((q^2*t-1)/(q*t-1))*McdH[1] # McdH[1, 1] + ((q*t^2-1)/(q*t-1))*McdH[1] # McdH[2] + ((q^2*t-1)/(q*t-1))*McdH[1, 1] # McdH[1] + ((q*t^2-1)/(q*t-1))*McdH[2] # McdH[1] + McdH[2, 1] # McdH[]\n sage: HLQp = SymmetricFunctions(QQ['t'].fraction_field()).hall_littlewood().Qp()\n sage: HLQp[2,1].coproduct()\n HLQp[] # HLQp[2, 1] + HLQp[1] # HLQp[1, 1] + HLQp[1] # HLQp[2] + HLQp[1, 1] # HLQp[1] + HLQp[2] # HLQp[1] + HLQp[2, 1] # HLQp[]\n sage: Sym = SymmetricFunctions(FractionField(QQ['t']))\n sage: LLT = Sym.llt(3)\n sage: LLT.cospin([3,2,1]).coproduct()\n (t+1)*m[] # m[1, 1] + m[] # m[2] + (t+1)*m[1] # m[1] + (t+1)*m[1, 1] # m[] + m[2] # m[]\n sage: f = SymmetricFunctions(ZZ).f()\n sage: f[3].coproduct()\n f[] # f[3] + f[3] # f[]\n sage: f[3,2,1].coproduct()\n f[] # f[3, 2, 1] + f[1] # f[3, 2] + f[2] # f[3, 1] + f[2, 1] # f[3] + f[3] # f[2, 1] + f[3, 1] # f[2] + f[3, 2] # f[1] + f[3, 2, 1] # f[]\n " from sage.categories.tensor import tensor s = self.realization_of().schur() return self.tensor_square().sum(((coeff * tensor([self(s[x]), self(s[y])])) for ((x, y), coeff) in s(elt).coproduct()))
def coproduct_by_coercion(self, elt): "\n Return the coproduct of the element ``elt`` by coercion to\n the Schur basis.\n\n INPUT:\n\n - ``elt`` -- an instance of this basis\n\n OUTPUT:\n\n - The coproduct acting on ``elt``, the result is an element of the\n tensor squared of the basis ``self``\n\n EXAMPLES::\n\n sage: m = SymmetricFunctions(QQ).m()\n sage: m[3,1,1].coproduct()\n m[] # m[3, 1, 1] + m[1] # m[3, 1] + m[1, 1] # m[3] + m[3] # m[1, 1] + m[3, 1] # m[1] + m[3, 1, 1] # m[]\n sage: m.coproduct_by_coercion(m[2,1])\n m[] # m[2, 1] + m[1] # m[2] + m[2] # m[1] + m[2, 1] # m[]\n sage: m.coproduct_by_coercion(m[2,1]) == m([2,1]).coproduct()\n True\n sage: McdH = SymmetricFunctions(QQ['q','t'].fraction_field()).macdonald().H()\n sage: McdH[2,1].coproduct()\n McdH[] # McdH[2, 1] + ((q^2*t-1)/(q*t-1))*McdH[1] # McdH[1, 1] + ((q*t^2-1)/(q*t-1))*McdH[1] # McdH[2] + ((q^2*t-1)/(q*t-1))*McdH[1, 1] # McdH[1] + ((q*t^2-1)/(q*t-1))*McdH[2] # McdH[1] + McdH[2, 1] # McdH[]\n sage: HLQp = SymmetricFunctions(QQ['t'].fraction_field()).hall_littlewood().Qp()\n sage: HLQp[2,1].coproduct()\n HLQp[] # HLQp[2, 1] + HLQp[1] # HLQp[1, 1] + HLQp[1] # HLQp[2] + HLQp[1, 1] # HLQp[1] + HLQp[2] # HLQp[1] + HLQp[2, 1] # HLQp[]\n sage: Sym = SymmetricFunctions(FractionField(QQ['t']))\n sage: LLT = Sym.llt(3)\n sage: LLT.cospin([3,2,1]).coproduct()\n (t+1)*m[] # m[1, 1] + m[] # m[2] + (t+1)*m[1] # m[1] + (t+1)*m[1, 1] # m[] + m[2] # m[]\n sage: f = SymmetricFunctions(ZZ).f()\n sage: f[3].coproduct()\n f[] # f[3] + f[3] # f[]\n sage: f[3,2,1].coproduct()\n f[] # f[3, 2, 1] + f[1] # f[3, 2] + f[2] # f[3, 1] + f[2, 1] # f[3] + f[3] # f[2, 1] + f[3, 1] # f[2] + f[3, 2] # f[1] + f[3, 2, 1] # f[]\n " from sage.categories.tensor import tensor s = self.realization_of().schur() return self.tensor_square().sum(((coeff * tensor([self(s[x]), self(s[y])])) for ((x, y), coeff) in s(elt).coproduct()))<|docstring|>Return the coproduct of the element ``elt`` by coercion to the Schur basis. INPUT: - ``elt`` -- an instance of this basis OUTPUT: - The coproduct acting on ``elt``, the result is an element of the tensor squared of the basis ``self`` EXAMPLES:: sage: m = SymmetricFunctions(QQ).m() sage: m[3,1,1].coproduct() m[] # m[3, 1, 1] + m[1] # m[3, 1] + m[1, 1] # m[3] + m[3] # m[1, 1] + m[3, 1] # m[1] + m[3, 1, 1] # m[] sage: m.coproduct_by_coercion(m[2,1]) m[] # m[2, 1] + m[1] # m[2] + m[2] # m[1] + m[2, 1] # m[] sage: m.coproduct_by_coercion(m[2,1]) == m([2,1]).coproduct() True sage: McdH = SymmetricFunctions(QQ['q','t'].fraction_field()).macdonald().H() sage: McdH[2,1].coproduct() McdH[] # McdH[2, 1] + ((q^2*t-1)/(q*t-1))*McdH[1] # McdH[1, 1] + ((q*t^2-1)/(q*t-1))*McdH[1] # McdH[2] + ((q^2*t-1)/(q*t-1))*McdH[1, 1] # McdH[1] + ((q*t^2-1)/(q*t-1))*McdH[2] # McdH[1] + McdH[2, 1] # McdH[] sage: HLQp = SymmetricFunctions(QQ['t'].fraction_field()).hall_littlewood().Qp() sage: HLQp[2,1].coproduct() HLQp[] # HLQp[2, 1] + HLQp[1] # HLQp[1, 1] + HLQp[1] # HLQp[2] + HLQp[1, 1] # HLQp[1] + HLQp[2] # HLQp[1] + HLQp[2, 1] # HLQp[] sage: Sym = SymmetricFunctions(FractionField(QQ['t'])) sage: LLT = Sym.llt(3) sage: LLT.cospin([3,2,1]).coproduct() (t+1)*m[] # m[1, 1] + m[] # m[2] + (t+1)*m[1] # m[1] + (t+1)*m[1, 1] # m[] + m[2] # m[] sage: f = SymmetricFunctions(ZZ).f() sage: f[3].coproduct() f[] # f[3] + f[3] # f[] sage: f[3,2,1].coproduct() f[] # f[3, 2, 1] + f[1] # f[3, 2] + f[2] # f[3, 1] + f[2, 1] # f[3] + f[3] # f[2, 1] + f[3, 1] # f[2] + f[3, 2] # f[1] + f[3, 2, 1] # f[]<|endoftext|>
be47ff922606f3fbd460d197c2527a1759d45fe42b0b077f86d70f9273c66c04
def plethysm(self, x, include=None, exclude=None): "\n Return the outer plethysm of ``self`` with ``x``. This is\n implemented only over base rings which are `\\QQ`-algebras.\n (To compute outer plethysms over general binomial rings, change\n bases to the fraction field.)\n\n By default, the degree one elements are taken to be the\n generators for the ``self``'s base ring. This setting can be\n modified by specifying the ``include`` and ``exclude`` keywords.\n\n INPUT:\n\n - ``x`` -- a symmetric function over the same base ring as\n ``self``\n\n - ``include`` -- a list of variables to be treated as\n degree one elements instead of the default degree one elements\n\n - ``exclude`` -- a list of variables to be excluded\n from the default degree one elements\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.s()\n sage: h = Sym.h()\n sage: s ( h([3])( h([2]) ) )\n s[2, 2, 2] + s[4, 2] + s[6]\n sage: p = Sym.p()\n sage: p([3])( s([2,1]) )\n 1/3*p[3, 3, 3] - 1/3*p[9]\n sage: e = Sym.e()\n sage: e([3])( e([2]) )\n e[3, 3] + e[4, 1, 1] - 2*e[4, 2] - e[5, 1] + e[6]\n\n ::\n\n sage: R.<t> = QQ[]\n sage: s = SymmetricFunctions(R).s()\n sage: a = s([3])\n sage: f = t*s([2])\n sage: a(f)\n t^3*s[2, 2, 2] + t^3*s[4, 2] + t^3*s[6]\n sage: f(a)\n t*s[4, 2] + t*s[6]\n sage: s(0).plethysm(s[1])\n 0\n sage: s(1).plethysm(s[1])\n s[]\n sage: s(1).plethysm(s(0))\n s[]\n\n .. SEEALSO::\n\n :meth:`frobenius`\n " if (not is_SymmetricFunction(x)): raise TypeError('only know how to compute plethysms between symmetric functions') parent = self.parent() p = parent.realization_of().power() R = parent.base_ring() p_x = p(x) if (self == parent.zero()): return self if ((include is not None) and (exclude is not None)): raise RuntimeError('include and exclude cannot both be specified') try: degree_one = [R(g) for g in R.variable_names_recursive()] except AttributeError: try: degree_one = R.gens() except NotImplementedError: degree_one = [] if include: degree_one = [R(g) for g in include] if exclude: degree_one = [g for g in degree_one if (g not in exclude)] scale_part = (lambda n: (lambda m: m.__class__(m.parent(), [(i * n) for i in m]))) raise_c = (lambda n: (lambda c: c.subs(**dict(((str(g), (g ** n)) for g in degree_one if (g != 1)))))) pn_pleth = (lambda f, n: f.map_support(scale_part(n))) f = (lambda part: prod((pn_pleth(p_x.map_coefficients(raise_c(i)), i) for i in part))) return parent(p._apply_module_morphism(p(self), f))
Return the outer plethysm of ``self`` with ``x``. This is implemented only over base rings which are `\QQ`-algebras. (To compute outer plethysms over general binomial rings, change bases to the fraction field.) By default, the degree one elements are taken to be the generators for the ``self``'s base ring. This setting can be modified by specifying the ``include`` and ``exclude`` keywords. INPUT: - ``x`` -- a symmetric function over the same base ring as ``self`` - ``include`` -- a list of variables to be treated as degree one elements instead of the default degree one elements - ``exclude`` -- a list of variables to be excluded from the default degree one elements EXAMPLES:: sage: Sym = SymmetricFunctions(QQ) sage: s = Sym.s() sage: h = Sym.h() sage: s ( h([3])( h([2]) ) ) s[2, 2, 2] + s[4, 2] + s[6] sage: p = Sym.p() sage: p([3])( s([2,1]) ) 1/3*p[3, 3, 3] - 1/3*p[9] sage: e = Sym.e() sage: e([3])( e([2]) ) e[3, 3] + e[4, 1, 1] - 2*e[4, 2] - e[5, 1] + e[6] :: sage: R.<t> = QQ[] sage: s = SymmetricFunctions(R).s() sage: a = s([3]) sage: f = t*s([2]) sage: a(f) t^3*s[2, 2, 2] + t^3*s[4, 2] + t^3*s[6] sage: f(a) t*s[4, 2] + t*s[6] sage: s(0).plethysm(s[1]) 0 sage: s(1).plethysm(s[1]) s[] sage: s(1).plethysm(s(0)) s[] .. SEEALSO:: :meth:`frobenius`
src/sage/combinat/sf/sfa.py
plethysm
bopopescu/sagesmc
5
python
def plethysm(self, x, include=None, exclude=None): "\n Return the outer plethysm of ``self`` with ``x``. This is\n implemented only over base rings which are `\\QQ`-algebras.\n (To compute outer plethysms over general binomial rings, change\n bases to the fraction field.)\n\n By default, the degree one elements are taken to be the\n generators for the ``self``'s base ring. This setting can be\n modified by specifying the ``include`` and ``exclude`` keywords.\n\n INPUT:\n\n - ``x`` -- a symmetric function over the same base ring as\n ``self``\n\n - ``include`` -- a list of variables to be treated as\n degree one elements instead of the default degree one elements\n\n - ``exclude`` -- a list of variables to be excluded\n from the default degree one elements\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.s()\n sage: h = Sym.h()\n sage: s ( h([3])( h([2]) ) )\n s[2, 2, 2] + s[4, 2] + s[6]\n sage: p = Sym.p()\n sage: p([3])( s([2,1]) )\n 1/3*p[3, 3, 3] - 1/3*p[9]\n sage: e = Sym.e()\n sage: e([3])( e([2]) )\n e[3, 3] + e[4, 1, 1] - 2*e[4, 2] - e[5, 1] + e[6]\n\n ::\n\n sage: R.<t> = QQ[]\n sage: s = SymmetricFunctions(R).s()\n sage: a = s([3])\n sage: f = t*s([2])\n sage: a(f)\n t^3*s[2, 2, 2] + t^3*s[4, 2] + t^3*s[6]\n sage: f(a)\n t*s[4, 2] + t*s[6]\n sage: s(0).plethysm(s[1])\n 0\n sage: s(1).plethysm(s[1])\n s[]\n sage: s(1).plethysm(s(0))\n s[]\n\n .. SEEALSO::\n\n :meth:`frobenius`\n " if (not is_SymmetricFunction(x)): raise TypeError('only know how to compute plethysms between symmetric functions') parent = self.parent() p = parent.realization_of().power() R = parent.base_ring() p_x = p(x) if (self == parent.zero()): return self if ((include is not None) and (exclude is not None)): raise RuntimeError('include and exclude cannot both be specified') try: degree_one = [R(g) for g in R.variable_names_recursive()] except AttributeError: try: degree_one = R.gens() except NotImplementedError: degree_one = [] if include: degree_one = [R(g) for g in include] if exclude: degree_one = [g for g in degree_one if (g not in exclude)] scale_part = (lambda n: (lambda m: m.__class__(m.parent(), [(i * n) for i in m]))) raise_c = (lambda n: (lambda c: c.subs(**dict(((str(g), (g ** n)) for g in degree_one if (g != 1)))))) pn_pleth = (lambda f, n: f.map_support(scale_part(n))) f = (lambda part: prod((pn_pleth(p_x.map_coefficients(raise_c(i)), i) for i in part))) return parent(p._apply_module_morphism(p(self), f))
def plethysm(self, x, include=None, exclude=None): "\n Return the outer plethysm of ``self`` with ``x``. This is\n implemented only over base rings which are `\\QQ`-algebras.\n (To compute outer plethysms over general binomial rings, change\n bases to the fraction field.)\n\n By default, the degree one elements are taken to be the\n generators for the ``self``'s base ring. This setting can be\n modified by specifying the ``include`` and ``exclude`` keywords.\n\n INPUT:\n\n - ``x`` -- a symmetric function over the same base ring as\n ``self``\n\n - ``include`` -- a list of variables to be treated as\n degree one elements instead of the default degree one elements\n\n - ``exclude`` -- a list of variables to be excluded\n from the default degree one elements\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.s()\n sage: h = Sym.h()\n sage: s ( h([3])( h([2]) ) )\n s[2, 2, 2] + s[4, 2] + s[6]\n sage: p = Sym.p()\n sage: p([3])( s([2,1]) )\n 1/3*p[3, 3, 3] - 1/3*p[9]\n sage: e = Sym.e()\n sage: e([3])( e([2]) )\n e[3, 3] + e[4, 1, 1] - 2*e[4, 2] - e[5, 1] + e[6]\n\n ::\n\n sage: R.<t> = QQ[]\n sage: s = SymmetricFunctions(R).s()\n sage: a = s([3])\n sage: f = t*s([2])\n sage: a(f)\n t^3*s[2, 2, 2] + t^3*s[4, 2] + t^3*s[6]\n sage: f(a)\n t*s[4, 2] + t*s[6]\n sage: s(0).plethysm(s[1])\n 0\n sage: s(1).plethysm(s[1])\n s[]\n sage: s(1).plethysm(s(0))\n s[]\n\n .. SEEALSO::\n\n :meth:`frobenius`\n " if (not is_SymmetricFunction(x)): raise TypeError('only know how to compute plethysms between symmetric functions') parent = self.parent() p = parent.realization_of().power() R = parent.base_ring() p_x = p(x) if (self == parent.zero()): return self if ((include is not None) and (exclude is not None)): raise RuntimeError('include and exclude cannot both be specified') try: degree_one = [R(g) for g in R.variable_names_recursive()] except AttributeError: try: degree_one = R.gens() except NotImplementedError: degree_one = [] if include: degree_one = [R(g) for g in include] if exclude: degree_one = [g for g in degree_one if (g not in exclude)] scale_part = (lambda n: (lambda m: m.__class__(m.parent(), [(i * n) for i in m]))) raise_c = (lambda n: (lambda c: c.subs(**dict(((str(g), (g ** n)) for g in degree_one if (g != 1)))))) pn_pleth = (lambda f, n: f.map_support(scale_part(n))) f = (lambda part: prod((pn_pleth(p_x.map_coefficients(raise_c(i)), i) for i in part))) return parent(p._apply_module_morphism(p(self), f))<|docstring|>Return the outer plethysm of ``self`` with ``x``. This is implemented only over base rings which are `\QQ`-algebras. (To compute outer plethysms over general binomial rings, change bases to the fraction field.) By default, the degree one elements are taken to be the generators for the ``self``'s base ring. This setting can be modified by specifying the ``include`` and ``exclude`` keywords. INPUT: - ``x`` -- a symmetric function over the same base ring as ``self`` - ``include`` -- a list of variables to be treated as degree one elements instead of the default degree one elements - ``exclude`` -- a list of variables to be excluded from the default degree one elements EXAMPLES:: sage: Sym = SymmetricFunctions(QQ) sage: s = Sym.s() sage: h = Sym.h() sage: s ( h([3])( h([2]) ) ) s[2, 2, 2] + s[4, 2] + s[6] sage: p = Sym.p() sage: p([3])( s([2,1]) ) 1/3*p[3, 3, 3] - 1/3*p[9] sage: e = Sym.e() sage: e([3])( e([2]) ) e[3, 3] + e[4, 1, 1] - 2*e[4, 2] - e[5, 1] + e[6] :: sage: R.<t> = QQ[] sage: s = SymmetricFunctions(R).s() sage: a = s([3]) sage: f = t*s([2]) sage: a(f) t^3*s[2, 2, 2] + t^3*s[4, 2] + t^3*s[6] sage: f(a) t*s[4, 2] + t*s[6] sage: s(0).plethysm(s[1]) 0 sage: s(1).plethysm(s[1]) s[] sage: s(1).plethysm(s(0)) s[] .. SEEALSO:: :meth:`frobenius`<|endoftext|>
83f50dd535aa518bb577e93e8ba9c1feb124cbd6df672b01055519a39409285e
def inner_plethysm(self, x): "\n Return the inner plethysm of ``self`` with ``x``.\n\n Whenever `R` is a `\\QQ`-algebra, and `f` and `g` are two\n symmetric functions over `R` such that the constant term of `f`\n is zero, the inner plethysm of `f` with `g` is a symmetric\n function over `R`, and the degree of this symmetric function is\n the same as the degree of `g`. We will denote the inner plethysm\n of `f` with `g` by `f \\{ g \\}` (in contrast to the notation of\n outer plethysm which is generally denoted `f [ g ]`); in Sage\n syntax, it is ``f.inner_plethysm(g)``.\n\n First we describe the axiomatic definition of the operation; see\n below for a representation-theoretic interpretation.\n In the following equations, we denote the outer product\n (i.e., the standard product on the ring of symmetric functions,\n :meth:`~sage.categories.algebras_with_basis.AlgebrasWithBasis.ParentMethods.product`)\n by `\\cdot` and the Kronecker product (:meth:`itensor`) by `\\ast`).\n\n .. MATH::\n\n (f + g) \\{ h \\} = f \\{ h \\} + g \\{ h \\}\n\n (f \\cdot g) \\{ h \\} = (f \\{ h \\}) \\ast (g \\{ h \\})\n\n p_k \\{ f + g \\} = p_k \\{ f \\} + p_k \\{ g \\}\n\n where `p_k` is the `k`-th power-sum symmetric function for every\n `k > 0`.\n\n Let `\\sigma` be a permutation of cycle type `\\mu` and let `\\mu^k`\n be the cycle type of `\\sigma^k`. Then,\n\n .. MATH::\n\n p_k \\{ p_\\mu/z_\\mu \\} = \\sum_{\\nu : \\nu^k = \\mu } p_{\\nu}/z_{\\nu}\n\n Since `(p_\\mu/z_\\mu)_{\\mu}` is a basis for the symmetric\n functions, these four formulas define the symmetric function\n operation `f \\{ g \\}` for any symmetric functions `f` and `g`\n (where `f` has constant term `0`) by expanding `f` in the\n power sum basis and `g` in the dual basis `p_\\mu/z_\\mu`.\n\n .. SEEALSO:: :meth:`itensor`, :func:`~sage.combinat.partition.partition_power`,\n :meth:`plethysm`\n\n This operation admits a representation-theoretic interpretation\n in the case where `f` is a Schur function `s_\\lambda` and\n `g` is a homogeneous degree `n` symmetric function with\n nonnegative integral coefficients in the Schur basis.\n The symmetric function `f \\{ g \\}` is the Frobenius\n image of the `S_n`-representation constructed as follows.\n\n The assumptions on `g` imply that `g` is the Frobenius image of a\n representation `\\rho` of the symmetric group `S_n`:\n\n .. MATH::\n\n \\rho : S_n \\to GL_N.\n\n If the degree `N` of this representation is greater than or equal\n to the number of parts of `\\lambda`, then `f`, which denotes `s_\\lambda`,\n corresponds to the character of some irreducible `GL_N`-representation, say\n\n .. MATH::\n\n \\sigma : GL_N \\to GL_M.\n\n The composition `\\sigma \\circ \\rho : S_n \\to GL_M` is a representation\n of `S_n` whose Frobenius image is precisely `f \\{ g \\}`.\n\n If `N` is less than the number of parts of `\\lambda`,\n then `f \\{ g \\}` is `0` by definition.\n\n When `f` is a symmetric function with constant term `\\neq 0`, the\n inner plethysm `f \\{ g \\}` isn't well-defined in the ring of\n symmetric functions. Indeed, it is not clear how to define\n `1 \\{ g \\}`. The most sensible way to get around this probably is\n defining it as the infinite sum `h_0 + h_1 + h_2 + \\cdots` (where\n `h_i` means the `i`-th complete homogeneous symmetric function)\n in the completion of this ring with respect to its grading. This is\n how [SchaThi1994]_ defines `1 \\{ g \\}`. The present method,\n however, sets it to be the sum of `h_i` over all `i` for which the\n `i`-th homogeneous component of `g` is nonzero. This is rather a\n hack than a reasonable definition. Use with caution!\n\n .. NOTE::\n\n If a symmetric function `g` is written in the form\n `g = g_0 + g_1 + g_2 + \\cdots` with each `g_i` homogeneous\n of degree `i`, then\n `f \\{ g \\} = f \\{ g_0 \\} + f \\{ g_1 \\} + f \\{ g_2 \\} + \\cdots`\n for every `f` with constant term `0`. But in general, inner\n plethysm is not linear in the second variable.\n\n REFERENCES:\n\n .. [King] King, R. Branching rules for `GL_m \\supset \\Sigma_n`\n and the evaluation of inner plethysms.\n J. Math. Phys. 15, 258 (1974) :doi:`10.1063/1.1666632`\n\n .. [SchaThi1994] Thomas Scharf, Jean-Yves Thibon.\n *A Hopf-algebra approach to inner plethysm*.\n Advances in Mathematics 104 (1994), pp. 30-58.\n ftp://ftp.mathe2.uni-bayreuth.de/axel/papers/scharf:a_hopf_algebra_approach_to_inner_plethysm.ps.gz\n\n INPUT:\n\n - ``x`` -- element of the ring of symmetric functions over the same\n base ring as ``self``\n\n OUTPUT:\n\n - an element of symmetric functions in the parent of ``self``\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.schur()\n sage: p = Sym.power()\n sage: h = Sym.complete()\n sage: s([2,1]).inner_plethysm(s([1,1,1]))\n 0\n sage: s([2]).inner_plethysm(s([2,1]))\n s[2, 1] + s[3]\n sage: s([1,1]).inner_plethysm(s([2,1]))\n s[1, 1, 1]\n sage: s[2,1].inner_tensor(s[2,1])\n s[1, 1, 1] + s[2, 1] + s[3]\n\n ::\n\n sage: f = s([2,1]) + 2*s([3,1])\n sage: f.itensor(f)\n s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4]\n sage: s( h([1,1]).inner_plethysm(f) )\n s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4]\n\n ::\n\n sage: s([]).inner_plethysm(s([1,1]) + 2*s([2,1])+s([3]))\n s[2] + s[3]\n sage: [s([]).inner_plethysm(s(la)) for la in Partitions(4)]\n [s[4], s[4], s[4], s[4], s[4]]\n sage: s([3]).inner_plethysm(s([]))\n s[]\n sage: s[1,1,1,1].inner_plethysm(s[2,1])\n 0\n sage: s[1,1,1,1].inner_plethysm(2*s[2,1])\n s[3]\n\n ::\n\n sage: p[3].inner_plethysm(p[3])\n 0\n sage: p[3,3].inner_plethysm(p[3])\n 0\n sage: p[3].inner_plethysm(p[1,1,1])\n p[1, 1, 1] + 2*p[3]\n sage: p[4].inner_plethysm(p[1,1,1,1]/24)\n 1/24*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] + 1/8*p[2, 2] + 1/4*p[4]\n sage: p[3,3].inner_plethysm(p[1,1,1])\n 6*p[1, 1, 1] + 12*p[3]\n\n TESTS::\n\n sage: s(0).inner_plethysm(s(0))\n 0\n sage: s(1).inner_plethysm(s(0))\n 0\n sage: s(0).inner_plethysm(s(1))\n 0\n sage: s(1).inner_plethysm(s(1))\n s[]\n sage: s(2).inner_plethysm(s(1))\n 2*s[]\n sage: s(1).inner_plethysm(s(2))\n s[]\n " parent = self.parent() if (self == parent.zero()): return self p = parent.realization_of().power() cache = {} ip_pnu_g = parent._inner_plethysm_pnu_g return sum(((c * ip_pnu_g(p(x), cache, nu)) for (nu, c) in p(self).monomial_coefficients().iteritems()))
Return the inner plethysm of ``self`` with ``x``. Whenever `R` is a `\QQ`-algebra, and `f` and `g` are two symmetric functions over `R` such that the constant term of `f` is zero, the inner plethysm of `f` with `g` is a symmetric function over `R`, and the degree of this symmetric function is the same as the degree of `g`. We will denote the inner plethysm of `f` with `g` by `f \{ g \}` (in contrast to the notation of outer plethysm which is generally denoted `f [ g ]`); in Sage syntax, it is ``f.inner_plethysm(g)``. First we describe the axiomatic definition of the operation; see below for a representation-theoretic interpretation. In the following equations, we denote the outer product (i.e., the standard product on the ring of symmetric functions, :meth:`~sage.categories.algebras_with_basis.AlgebrasWithBasis.ParentMethods.product`) by `\cdot` and the Kronecker product (:meth:`itensor`) by `\ast`). .. MATH:: (f + g) \{ h \} = f \{ h \} + g \{ h \} (f \cdot g) \{ h \} = (f \{ h \}) \ast (g \{ h \}) p_k \{ f + g \} = p_k \{ f \} + p_k \{ g \} where `p_k` is the `k`-th power-sum symmetric function for every `k > 0`. Let `\sigma` be a permutation of cycle type `\mu` and let `\mu^k` be the cycle type of `\sigma^k`. Then, .. MATH:: p_k \{ p_\mu/z_\mu \} = \sum_{\nu : \nu^k = \mu } p_{\nu}/z_{\nu} Since `(p_\mu/z_\mu)_{\mu}` is a basis for the symmetric functions, these four formulas define the symmetric function operation `f \{ g \}` for any symmetric functions `f` and `g` (where `f` has constant term `0`) by expanding `f` in the power sum basis and `g` in the dual basis `p_\mu/z_\mu`. .. SEEALSO:: :meth:`itensor`, :func:`~sage.combinat.partition.partition_power`, :meth:`plethysm` This operation admits a representation-theoretic interpretation in the case where `f` is a Schur function `s_\lambda` and `g` is a homogeneous degree `n` symmetric function with nonnegative integral coefficients in the Schur basis. The symmetric function `f \{ g \}` is the Frobenius image of the `S_n`-representation constructed as follows. The assumptions on `g` imply that `g` is the Frobenius image of a representation `\rho` of the symmetric group `S_n`: .. MATH:: \rho : S_n \to GL_N. If the degree `N` of this representation is greater than or equal to the number of parts of `\lambda`, then `f`, which denotes `s_\lambda`, corresponds to the character of some irreducible `GL_N`-representation, say .. MATH:: \sigma : GL_N \to GL_M. The composition `\sigma \circ \rho : S_n \to GL_M` is a representation of `S_n` whose Frobenius image is precisely `f \{ g \}`. If `N` is less than the number of parts of `\lambda`, then `f \{ g \}` is `0` by definition. When `f` is a symmetric function with constant term `\neq 0`, the inner plethysm `f \{ g \}` isn't well-defined in the ring of symmetric functions. Indeed, it is not clear how to define `1 \{ g \}`. The most sensible way to get around this probably is defining it as the infinite sum `h_0 + h_1 + h_2 + \cdots` (where `h_i` means the `i`-th complete homogeneous symmetric function) in the completion of this ring with respect to its grading. This is how [SchaThi1994]_ defines `1 \{ g \}`. The present method, however, sets it to be the sum of `h_i` over all `i` for which the `i`-th homogeneous component of `g` is nonzero. This is rather a hack than a reasonable definition. Use with caution! .. NOTE:: If a symmetric function `g` is written in the form `g = g_0 + g_1 + g_2 + \cdots` with each `g_i` homogeneous of degree `i`, then `f \{ g \} = f \{ g_0 \} + f \{ g_1 \} + f \{ g_2 \} + \cdots` for every `f` with constant term `0`. But in general, inner plethysm is not linear in the second variable. REFERENCES: .. [King] King, R. Branching rules for `GL_m \supset \Sigma_n` and the evaluation of inner plethysms. J. Math. Phys. 15, 258 (1974) :doi:`10.1063/1.1666632` .. [SchaThi1994] Thomas Scharf, Jean-Yves Thibon. *A Hopf-algebra approach to inner plethysm*. Advances in Mathematics 104 (1994), pp. 30-58. ftp://ftp.mathe2.uni-bayreuth.de/axel/papers/scharf:a_hopf_algebra_approach_to_inner_plethysm.ps.gz INPUT: - ``x`` -- element of the ring of symmetric functions over the same base ring as ``self`` OUTPUT: - an element of symmetric functions in the parent of ``self`` EXAMPLES:: sage: Sym = SymmetricFunctions(QQ) sage: s = Sym.schur() sage: p = Sym.power() sage: h = Sym.complete() sage: s([2,1]).inner_plethysm(s([1,1,1])) 0 sage: s([2]).inner_plethysm(s([2,1])) s[2, 1] + s[3] sage: s([1,1]).inner_plethysm(s([2,1])) s[1, 1, 1] sage: s[2,1].inner_tensor(s[2,1]) s[1, 1, 1] + s[2, 1] + s[3] :: sage: f = s([2,1]) + 2*s([3,1]) sage: f.itensor(f) s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4] sage: s( h([1,1]).inner_plethysm(f) ) s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4] :: sage: s([]).inner_plethysm(s([1,1]) + 2*s([2,1])+s([3])) s[2] + s[3] sage: [s([]).inner_plethysm(s(la)) for la in Partitions(4)] [s[4], s[4], s[4], s[4], s[4]] sage: s([3]).inner_plethysm(s([])) s[] sage: s[1,1,1,1].inner_plethysm(s[2,1]) 0 sage: s[1,1,1,1].inner_plethysm(2*s[2,1]) s[3] :: sage: p[3].inner_plethysm(p[3]) 0 sage: p[3,3].inner_plethysm(p[3]) 0 sage: p[3].inner_plethysm(p[1,1,1]) p[1, 1, 1] + 2*p[3] sage: p[4].inner_plethysm(p[1,1,1,1]/24) 1/24*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] + 1/8*p[2, 2] + 1/4*p[4] sage: p[3,3].inner_plethysm(p[1,1,1]) 6*p[1, 1, 1] + 12*p[3] TESTS:: sage: s(0).inner_plethysm(s(0)) 0 sage: s(1).inner_plethysm(s(0)) 0 sage: s(0).inner_plethysm(s(1)) 0 sage: s(1).inner_plethysm(s(1)) s[] sage: s(2).inner_plethysm(s(1)) 2*s[] sage: s(1).inner_plethysm(s(2)) s[]
src/sage/combinat/sf/sfa.py
inner_plethysm
bopopescu/sagesmc
5
python
def inner_plethysm(self, x): "\n Return the inner plethysm of ``self`` with ``x``.\n\n Whenever `R` is a `\\QQ`-algebra, and `f` and `g` are two\n symmetric functions over `R` such that the constant term of `f`\n is zero, the inner plethysm of `f` with `g` is a symmetric\n function over `R`, and the degree of this symmetric function is\n the same as the degree of `g`. We will denote the inner plethysm\n of `f` with `g` by `f \\{ g \\}` (in contrast to the notation of\n outer plethysm which is generally denoted `f [ g ]`); in Sage\n syntax, it is ``f.inner_plethysm(g)``.\n\n First we describe the axiomatic definition of the operation; see\n below for a representation-theoretic interpretation.\n In the following equations, we denote the outer product\n (i.e., the standard product on the ring of symmetric functions,\n :meth:`~sage.categories.algebras_with_basis.AlgebrasWithBasis.ParentMethods.product`)\n by `\\cdot` and the Kronecker product (:meth:`itensor`) by `\\ast`).\n\n .. MATH::\n\n (f + g) \\{ h \\} = f \\{ h \\} + g \\{ h \\}\n\n (f \\cdot g) \\{ h \\} = (f \\{ h \\}) \\ast (g \\{ h \\})\n\n p_k \\{ f + g \\} = p_k \\{ f \\} + p_k \\{ g \\}\n\n where `p_k` is the `k`-th power-sum symmetric function for every\n `k > 0`.\n\n Let `\\sigma` be a permutation of cycle type `\\mu` and let `\\mu^k`\n be the cycle type of `\\sigma^k`. Then,\n\n .. MATH::\n\n p_k \\{ p_\\mu/z_\\mu \\} = \\sum_{\\nu : \\nu^k = \\mu } p_{\\nu}/z_{\\nu}\n\n Since `(p_\\mu/z_\\mu)_{\\mu}` is a basis for the symmetric\n functions, these four formulas define the symmetric function\n operation `f \\{ g \\}` for any symmetric functions `f` and `g`\n (where `f` has constant term `0`) by expanding `f` in the\n power sum basis and `g` in the dual basis `p_\\mu/z_\\mu`.\n\n .. SEEALSO:: :meth:`itensor`, :func:`~sage.combinat.partition.partition_power`,\n :meth:`plethysm`\n\n This operation admits a representation-theoretic interpretation\n in the case where `f` is a Schur function `s_\\lambda` and\n `g` is a homogeneous degree `n` symmetric function with\n nonnegative integral coefficients in the Schur basis.\n The symmetric function `f \\{ g \\}` is the Frobenius\n image of the `S_n`-representation constructed as follows.\n\n The assumptions on `g` imply that `g` is the Frobenius image of a\n representation `\\rho` of the symmetric group `S_n`:\n\n .. MATH::\n\n \\rho : S_n \\to GL_N.\n\n If the degree `N` of this representation is greater than or equal\n to the number of parts of `\\lambda`, then `f`, which denotes `s_\\lambda`,\n corresponds to the character of some irreducible `GL_N`-representation, say\n\n .. MATH::\n\n \\sigma : GL_N \\to GL_M.\n\n The composition `\\sigma \\circ \\rho : S_n \\to GL_M` is a representation\n of `S_n` whose Frobenius image is precisely `f \\{ g \\}`.\n\n If `N` is less than the number of parts of `\\lambda`,\n then `f \\{ g \\}` is `0` by definition.\n\n When `f` is a symmetric function with constant term `\\neq 0`, the\n inner plethysm `f \\{ g \\}` isn't well-defined in the ring of\n symmetric functions. Indeed, it is not clear how to define\n `1 \\{ g \\}`. The most sensible way to get around this probably is\n defining it as the infinite sum `h_0 + h_1 + h_2 + \\cdots` (where\n `h_i` means the `i`-th complete homogeneous symmetric function)\n in the completion of this ring with respect to its grading. This is\n how [SchaThi1994]_ defines `1 \\{ g \\}`. The present method,\n however, sets it to be the sum of `h_i` over all `i` for which the\n `i`-th homogeneous component of `g` is nonzero. This is rather a\n hack than a reasonable definition. Use with caution!\n\n .. NOTE::\n\n If a symmetric function `g` is written in the form\n `g = g_0 + g_1 + g_2 + \\cdots` with each `g_i` homogeneous\n of degree `i`, then\n `f \\{ g \\} = f \\{ g_0 \\} + f \\{ g_1 \\} + f \\{ g_2 \\} + \\cdots`\n for every `f` with constant term `0`. But in general, inner\n plethysm is not linear in the second variable.\n\n REFERENCES:\n\n .. [King] King, R. Branching rules for `GL_m \\supset \\Sigma_n`\n and the evaluation of inner plethysms.\n J. Math. Phys. 15, 258 (1974) :doi:`10.1063/1.1666632`\n\n .. [SchaThi1994] Thomas Scharf, Jean-Yves Thibon.\n *A Hopf-algebra approach to inner plethysm*.\n Advances in Mathematics 104 (1994), pp. 30-58.\n ftp://ftp.mathe2.uni-bayreuth.de/axel/papers/scharf:a_hopf_algebra_approach_to_inner_plethysm.ps.gz\n\n INPUT:\n\n - ``x`` -- element of the ring of symmetric functions over the same\n base ring as ``self``\n\n OUTPUT:\n\n - an element of symmetric functions in the parent of ``self``\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.schur()\n sage: p = Sym.power()\n sage: h = Sym.complete()\n sage: s([2,1]).inner_plethysm(s([1,1,1]))\n 0\n sage: s([2]).inner_plethysm(s([2,1]))\n s[2, 1] + s[3]\n sage: s([1,1]).inner_plethysm(s([2,1]))\n s[1, 1, 1]\n sage: s[2,1].inner_tensor(s[2,1])\n s[1, 1, 1] + s[2, 1] + s[3]\n\n ::\n\n sage: f = s([2,1]) + 2*s([3,1])\n sage: f.itensor(f)\n s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4]\n sage: s( h([1,1]).inner_plethysm(f) )\n s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4]\n\n ::\n\n sage: s([]).inner_plethysm(s([1,1]) + 2*s([2,1])+s([3]))\n s[2] + s[3]\n sage: [s([]).inner_plethysm(s(la)) for la in Partitions(4)]\n [s[4], s[4], s[4], s[4], s[4]]\n sage: s([3]).inner_plethysm(s([]))\n s[]\n sage: s[1,1,1,1].inner_plethysm(s[2,1])\n 0\n sage: s[1,1,1,1].inner_plethysm(2*s[2,1])\n s[3]\n\n ::\n\n sage: p[3].inner_plethysm(p[3])\n 0\n sage: p[3,3].inner_plethysm(p[3])\n 0\n sage: p[3].inner_plethysm(p[1,1,1])\n p[1, 1, 1] + 2*p[3]\n sage: p[4].inner_plethysm(p[1,1,1,1]/24)\n 1/24*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] + 1/8*p[2, 2] + 1/4*p[4]\n sage: p[3,3].inner_plethysm(p[1,1,1])\n 6*p[1, 1, 1] + 12*p[3]\n\n TESTS::\n\n sage: s(0).inner_plethysm(s(0))\n 0\n sage: s(1).inner_plethysm(s(0))\n 0\n sage: s(0).inner_plethysm(s(1))\n 0\n sage: s(1).inner_plethysm(s(1))\n s[]\n sage: s(2).inner_plethysm(s(1))\n 2*s[]\n sage: s(1).inner_plethysm(s(2))\n s[]\n " parent = self.parent() if (self == parent.zero()): return self p = parent.realization_of().power() cache = {} ip_pnu_g = parent._inner_plethysm_pnu_g return sum(((c * ip_pnu_g(p(x), cache, nu)) for (nu, c) in p(self).monomial_coefficients().iteritems()))
def inner_plethysm(self, x): "\n Return the inner plethysm of ``self`` with ``x``.\n\n Whenever `R` is a `\\QQ`-algebra, and `f` and `g` are two\n symmetric functions over `R` such that the constant term of `f`\n is zero, the inner plethysm of `f` with `g` is a symmetric\n function over `R`, and the degree of this symmetric function is\n the same as the degree of `g`. We will denote the inner plethysm\n of `f` with `g` by `f \\{ g \\}` (in contrast to the notation of\n outer plethysm which is generally denoted `f [ g ]`); in Sage\n syntax, it is ``f.inner_plethysm(g)``.\n\n First we describe the axiomatic definition of the operation; see\n below for a representation-theoretic interpretation.\n In the following equations, we denote the outer product\n (i.e., the standard product on the ring of symmetric functions,\n :meth:`~sage.categories.algebras_with_basis.AlgebrasWithBasis.ParentMethods.product`)\n by `\\cdot` and the Kronecker product (:meth:`itensor`) by `\\ast`).\n\n .. MATH::\n\n (f + g) \\{ h \\} = f \\{ h \\} + g \\{ h \\}\n\n (f \\cdot g) \\{ h \\} = (f \\{ h \\}) \\ast (g \\{ h \\})\n\n p_k \\{ f + g \\} = p_k \\{ f \\} + p_k \\{ g \\}\n\n where `p_k` is the `k`-th power-sum symmetric function for every\n `k > 0`.\n\n Let `\\sigma` be a permutation of cycle type `\\mu` and let `\\mu^k`\n be the cycle type of `\\sigma^k`. Then,\n\n .. MATH::\n\n p_k \\{ p_\\mu/z_\\mu \\} = \\sum_{\\nu : \\nu^k = \\mu } p_{\\nu}/z_{\\nu}\n\n Since `(p_\\mu/z_\\mu)_{\\mu}` is a basis for the symmetric\n functions, these four formulas define the symmetric function\n operation `f \\{ g \\}` for any symmetric functions `f` and `g`\n (where `f` has constant term `0`) by expanding `f` in the\n power sum basis and `g` in the dual basis `p_\\mu/z_\\mu`.\n\n .. SEEALSO:: :meth:`itensor`, :func:`~sage.combinat.partition.partition_power`,\n :meth:`plethysm`\n\n This operation admits a representation-theoretic interpretation\n in the case where `f` is a Schur function `s_\\lambda` and\n `g` is a homogeneous degree `n` symmetric function with\n nonnegative integral coefficients in the Schur basis.\n The symmetric function `f \\{ g \\}` is the Frobenius\n image of the `S_n`-representation constructed as follows.\n\n The assumptions on `g` imply that `g` is the Frobenius image of a\n representation `\\rho` of the symmetric group `S_n`:\n\n .. MATH::\n\n \\rho : S_n \\to GL_N.\n\n If the degree `N` of this representation is greater than or equal\n to the number of parts of `\\lambda`, then `f`, which denotes `s_\\lambda`,\n corresponds to the character of some irreducible `GL_N`-representation, say\n\n .. MATH::\n\n \\sigma : GL_N \\to GL_M.\n\n The composition `\\sigma \\circ \\rho : S_n \\to GL_M` is a representation\n of `S_n` whose Frobenius image is precisely `f \\{ g \\}`.\n\n If `N` is less than the number of parts of `\\lambda`,\n then `f \\{ g \\}` is `0` by definition.\n\n When `f` is a symmetric function with constant term `\\neq 0`, the\n inner plethysm `f \\{ g \\}` isn't well-defined in the ring of\n symmetric functions. Indeed, it is not clear how to define\n `1 \\{ g \\}`. The most sensible way to get around this probably is\n defining it as the infinite sum `h_0 + h_1 + h_2 + \\cdots` (where\n `h_i` means the `i`-th complete homogeneous symmetric function)\n in the completion of this ring with respect to its grading. This is\n how [SchaThi1994]_ defines `1 \\{ g \\}`. The present method,\n however, sets it to be the sum of `h_i` over all `i` for which the\n `i`-th homogeneous component of `g` is nonzero. This is rather a\n hack than a reasonable definition. Use with caution!\n\n .. NOTE::\n\n If a symmetric function `g` is written in the form\n `g = g_0 + g_1 + g_2 + \\cdots` with each `g_i` homogeneous\n of degree `i`, then\n `f \\{ g \\} = f \\{ g_0 \\} + f \\{ g_1 \\} + f \\{ g_2 \\} + \\cdots`\n for every `f` with constant term `0`. But in general, inner\n plethysm is not linear in the second variable.\n\n REFERENCES:\n\n .. [King] King, R. Branching rules for `GL_m \\supset \\Sigma_n`\n and the evaluation of inner plethysms.\n J. Math. Phys. 15, 258 (1974) :doi:`10.1063/1.1666632`\n\n .. [SchaThi1994] Thomas Scharf, Jean-Yves Thibon.\n *A Hopf-algebra approach to inner plethysm*.\n Advances in Mathematics 104 (1994), pp. 30-58.\n ftp://ftp.mathe2.uni-bayreuth.de/axel/papers/scharf:a_hopf_algebra_approach_to_inner_plethysm.ps.gz\n\n INPUT:\n\n - ``x`` -- element of the ring of symmetric functions over the same\n base ring as ``self``\n\n OUTPUT:\n\n - an element of symmetric functions in the parent of ``self``\n\n EXAMPLES::\n\n sage: Sym = SymmetricFunctions(QQ)\n sage: s = Sym.schur()\n sage: p = Sym.power()\n sage: h = Sym.complete()\n sage: s([2,1]).inner_plethysm(s([1,1,1]))\n 0\n sage: s([2]).inner_plethysm(s([2,1]))\n s[2, 1] + s[3]\n sage: s([1,1]).inner_plethysm(s([2,1]))\n s[1, 1, 1]\n sage: s[2,1].inner_tensor(s[2,1])\n s[1, 1, 1] + s[2, 1] + s[3]\n\n ::\n\n sage: f = s([2,1]) + 2*s([3,1])\n sage: f.itensor(f)\n s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4]\n sage: s( h([1,1]).inner_plethysm(f) )\n s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4]\n\n ::\n\n sage: s([]).inner_plethysm(s([1,1]) + 2*s([2,1])+s([3]))\n s[2] + s[3]\n sage: [s([]).inner_plethysm(s(la)) for la in Partitions(4)]\n [s[4], s[4], s[4], s[4], s[4]]\n sage: s([3]).inner_plethysm(s([]))\n s[]\n sage: s[1,1,1,1].inner_plethysm(s[2,1])\n 0\n sage: s[1,1,1,1].inner_plethysm(2*s[2,1])\n s[3]\n\n ::\n\n sage: p[3].inner_plethysm(p[3])\n 0\n sage: p[3,3].inner_plethysm(p[3])\n 0\n sage: p[3].inner_plethysm(p[1,1,1])\n p[1, 1, 1] + 2*p[3]\n sage: p[4].inner_plethysm(p[1,1,1,1]/24)\n 1/24*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] + 1/8*p[2, 2] + 1/4*p[4]\n sage: p[3,3].inner_plethysm(p[1,1,1])\n 6*p[1, 1, 1] + 12*p[3]\n\n TESTS::\n\n sage: s(0).inner_plethysm(s(0))\n 0\n sage: s(1).inner_plethysm(s(0))\n 0\n sage: s(0).inner_plethysm(s(1))\n 0\n sage: s(1).inner_plethysm(s(1))\n s[]\n sage: s(2).inner_plethysm(s(1))\n 2*s[]\n sage: s(1).inner_plethysm(s(2))\n s[]\n " parent = self.parent() if (self == parent.zero()): return self p = parent.realization_of().power() cache = {} ip_pnu_g = parent._inner_plethysm_pnu_g return sum(((c * ip_pnu_g(p(x), cache, nu)) for (nu, c) in p(self).monomial_coefficients().iteritems()))<|docstring|>Return the inner plethysm of ``self`` with ``x``. Whenever `R` is a `\QQ`-algebra, and `f` and `g` are two symmetric functions over `R` such that the constant term of `f` is zero, the inner plethysm of `f` with `g` is a symmetric function over `R`, and the degree of this symmetric function is the same as the degree of `g`. We will denote the inner plethysm of `f` with `g` by `f \{ g \}` (in contrast to the notation of outer plethysm which is generally denoted `f [ g ]`); in Sage syntax, it is ``f.inner_plethysm(g)``. First we describe the axiomatic definition of the operation; see below for a representation-theoretic interpretation. In the following equations, we denote the outer product (i.e., the standard product on the ring of symmetric functions, :meth:`~sage.categories.algebras_with_basis.AlgebrasWithBasis.ParentMethods.product`) by `\cdot` and the Kronecker product (:meth:`itensor`) by `\ast`). .. MATH:: (f + g) \{ h \} = f \{ h \} + g \{ h \} (f \cdot g) \{ h \} = (f \{ h \}) \ast (g \{ h \}) p_k \{ f + g \} = p_k \{ f \} + p_k \{ g \} where `p_k` is the `k`-th power-sum symmetric function for every `k > 0`. Let `\sigma` be a permutation of cycle type `\mu` and let `\mu^k` be the cycle type of `\sigma^k`. Then, .. MATH:: p_k \{ p_\mu/z_\mu \} = \sum_{\nu : \nu^k = \mu } p_{\nu}/z_{\nu} Since `(p_\mu/z_\mu)_{\mu}` is a basis for the symmetric functions, these four formulas define the symmetric function operation `f \{ g \}` for any symmetric functions `f` and `g` (where `f` has constant term `0`) by expanding `f` in the power sum basis and `g` in the dual basis `p_\mu/z_\mu`. .. SEEALSO:: :meth:`itensor`, :func:`~sage.combinat.partition.partition_power`, :meth:`plethysm` This operation admits a representation-theoretic interpretation in the case where `f` is a Schur function `s_\lambda` and `g` is a homogeneous degree `n` symmetric function with nonnegative integral coefficients in the Schur basis. The symmetric function `f \{ g \}` is the Frobenius image of the `S_n`-representation constructed as follows. The assumptions on `g` imply that `g` is the Frobenius image of a representation `\rho` of the symmetric group `S_n`: .. MATH:: \rho : S_n \to GL_N. If the degree `N` of this representation is greater than or equal to the number of parts of `\lambda`, then `f`, which denotes `s_\lambda`, corresponds to the character of some irreducible `GL_N`-representation, say .. MATH:: \sigma : GL_N \to GL_M. The composition `\sigma \circ \rho : S_n \to GL_M` is a representation of `S_n` whose Frobenius image is precisely `f \{ g \}`. If `N` is less than the number of parts of `\lambda`, then `f \{ g \}` is `0` by definition. When `f` is a symmetric function with constant term `\neq 0`, the inner plethysm `f \{ g \}` isn't well-defined in the ring of symmetric functions. Indeed, it is not clear how to define `1 \{ g \}`. The most sensible way to get around this probably is defining it as the infinite sum `h_0 + h_1 + h_2 + \cdots` (where `h_i` means the `i`-th complete homogeneous symmetric function) in the completion of this ring with respect to its grading. This is how [SchaThi1994]_ defines `1 \{ g \}`. The present method, however, sets it to be the sum of `h_i` over all `i` for which the `i`-th homogeneous component of `g` is nonzero. This is rather a hack than a reasonable definition. Use with caution! .. NOTE:: If a symmetric function `g` is written in the form `g = g_0 + g_1 + g_2 + \cdots` with each `g_i` homogeneous of degree `i`, then `f \{ g \} = f \{ g_0 \} + f \{ g_1 \} + f \{ g_2 \} + \cdots` for every `f` with constant term `0`. But in general, inner plethysm is not linear in the second variable. REFERENCES: .. [King] King, R. Branching rules for `GL_m \supset \Sigma_n` and the evaluation of inner plethysms. J. Math. Phys. 15, 258 (1974) :doi:`10.1063/1.1666632` .. [SchaThi1994] Thomas Scharf, Jean-Yves Thibon. *A Hopf-algebra approach to inner plethysm*. Advances in Mathematics 104 (1994), pp. 30-58. ftp://ftp.mathe2.uni-bayreuth.de/axel/papers/scharf:a_hopf_algebra_approach_to_inner_plethysm.ps.gz INPUT: - ``x`` -- element of the ring of symmetric functions over the same base ring as ``self`` OUTPUT: - an element of symmetric functions in the parent of ``self`` EXAMPLES:: sage: Sym = SymmetricFunctions(QQ) sage: s = Sym.schur() sage: p = Sym.power() sage: h = Sym.complete() sage: s([2,1]).inner_plethysm(s([1,1,1])) 0 sage: s([2]).inner_plethysm(s([2,1])) s[2, 1] + s[3] sage: s([1,1]).inner_plethysm(s([2,1])) s[1, 1, 1] sage: s[2,1].inner_tensor(s[2,1]) s[1, 1, 1] + s[2, 1] + s[3] :: sage: f = s([2,1]) + 2*s([3,1]) sage: f.itensor(f) s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4] sage: s( h([1,1]).inner_plethysm(f) ) s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4] :: sage: s([]).inner_plethysm(s([1,1]) + 2*s([2,1])+s([3])) s[2] + s[3] sage: [s([]).inner_plethysm(s(la)) for la in Partitions(4)] [s[4], s[4], s[4], s[4], s[4]] sage: s([3]).inner_plethysm(s([])) s[] sage: s[1,1,1,1].inner_plethysm(s[2,1]) 0 sage: s[1,1,1,1].inner_plethysm(2*s[2,1]) s[3] :: sage: p[3].inner_plethysm(p[3]) 0 sage: p[3,3].inner_plethysm(p[3]) 0 sage: p[3].inner_plethysm(p[1,1,1]) p[1, 1, 1] + 2*p[3] sage: p[4].inner_plethysm(p[1,1,1,1]/24) 1/24*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] + 1/8*p[2, 2] + 1/4*p[4] sage: p[3,3].inner_plethysm(p[1,1,1]) 6*p[1, 1, 1] + 12*p[3] TESTS:: sage: s(0).inner_plethysm(s(0)) 0 sage: s(1).inner_plethysm(s(0)) 0 sage: s(0).inner_plethysm(s(1)) 0 sage: s(1).inner_plethysm(s(1)) s[] sage: s(2).inner_plethysm(s(1)) 2*s[] sage: s(1).inner_plethysm(s(2)) s[]<|endoftext|>
5775d6225d67afcb048e2504600f8a279f572984ced27367e96a4f3a7f88177a
def omega(self): '\n Return the image of ``self`` under the omega automorphism.\n\n The omega automorphism is defined to be the unique algebra\n endomorphism `\\omega` of the ring of symmetric functions that\n satisfies `\\omega(e_k) = h_k` for all positive integers `k`\n (where `e_k` stands for the `k`-th elementary symmetric\n function, and `h_k` stands for the `k`-th complete homogeneous\n symmetric function). It furthermore is a Hopf algebra\n endomorphism, and sends the power-sum symmetric function `p_k`\n to `(-1)^{k-1} p_k` for every positive integer `k`.\n\n The default implementation converts to the Schurs, then\n performs the automorphism and changes back.\n\n EXAMPLES::\n\n sage: J = SymmetricFunctions(QQ).jack(t=1).P()\n sage: a = J([2,1]) + J([1,1,1])\n sage: a.omega()\n JackP[2, 1] + JackP[3]\n sage: J(0).omega()\n 0\n sage: J(1).omega()\n JackP[]\n\n The forgotten symmetric functions are the images of the monomial\n symmetric functions under omega::\n\n sage: Sym = SymmetricFunctions(ZZ)\n sage: m = Sym.m()\n sage: f = Sym.f()\n sage: all( f(lam) == m(lam).omega() for lam in Partitions(3) )\n True\n sage: all( m(lam) == f(lam).omega() for lam in Partitions(3) )\n True\n ' parent = self.parent() s = parent.realization_of().schur() return parent(s(self).omega())
Return the image of ``self`` under the omega automorphism. The omega automorphism is defined to be the unique algebra endomorphism `\omega` of the ring of symmetric functions that satisfies `\omega(e_k) = h_k` for all positive integers `k` (where `e_k` stands for the `k`-th elementary symmetric function, and `h_k` stands for the `k`-th complete homogeneous symmetric function). It furthermore is a Hopf algebra endomorphism, and sends the power-sum symmetric function `p_k` to `(-1)^{k-1} p_k` for every positive integer `k`. The default implementation converts to the Schurs, then performs the automorphism and changes back. EXAMPLES:: sage: J = SymmetricFunctions(QQ).jack(t=1).P() sage: a = J([2,1]) + J([1,1,1]) sage: a.omega() JackP[2, 1] + JackP[3] sage: J(0).omega() 0 sage: J(1).omega() JackP[] The forgotten symmetric functions are the images of the monomial symmetric functions under omega:: sage: Sym = SymmetricFunctions(ZZ) sage: m = Sym.m() sage: f = Sym.f() sage: all( f(lam) == m(lam).omega() for lam in Partitions(3) ) True sage: all( m(lam) == f(lam).omega() for lam in Partitions(3) ) True
src/sage/combinat/sf/sfa.py
omega
bopopescu/sagesmc
5
python
def omega(self): '\n Return the image of ``self`` under the omega automorphism.\n\n The omega automorphism is defined to be the unique algebra\n endomorphism `\\omega` of the ring of symmetric functions that\n satisfies `\\omega(e_k) = h_k` for all positive integers `k`\n (where `e_k` stands for the `k`-th elementary symmetric\n function, and `h_k` stands for the `k`-th complete homogeneous\n symmetric function). It furthermore is a Hopf algebra\n endomorphism, and sends the power-sum symmetric function `p_k`\n to `(-1)^{k-1} p_k` for every positive integer `k`.\n\n The default implementation converts to the Schurs, then\n performs the automorphism and changes back.\n\n EXAMPLES::\n\n sage: J = SymmetricFunctions(QQ).jack(t=1).P()\n sage: a = J([2,1]) + J([1,1,1])\n sage: a.omega()\n JackP[2, 1] + JackP[3]\n sage: J(0).omega()\n 0\n sage: J(1).omega()\n JackP[]\n\n The forgotten symmetric functions are the images of the monomial\n symmetric functions under omega::\n\n sage: Sym = SymmetricFunctions(ZZ)\n sage: m = Sym.m()\n sage: f = Sym.f()\n sage: all( f(lam) == m(lam).omega() for lam in Partitions(3) )\n True\n sage: all( m(lam) == f(lam).omega() for lam in Partitions(3) )\n True\n ' parent = self.parent() s = parent.realization_of().schur() return parent(s(self).omega())
def omega(self): '\n Return the image of ``self`` under the omega automorphism.\n\n The omega automorphism is defined to be the unique algebra\n endomorphism `\\omega` of the ring of symmetric functions that\n satisfies `\\omega(e_k) = h_k` for all positive integers `k`\n (where `e_k` stands for the `k`-th elementary symmetric\n function, and `h_k` stands for the `k`-th complete homogeneous\n symmetric function). It furthermore is a Hopf algebra\n endomorphism, and sends the power-sum symmetric function `p_k`\n to `(-1)^{k-1} p_k` for every positive integer `k`.\n\n The default implementation converts to the Schurs, then\n performs the automorphism and changes back.\n\n EXAMPLES::\n\n sage: J = SymmetricFunctions(QQ).jack(t=1).P()\n sage: a = J([2,1]) + J([1,1,1])\n sage: a.omega()\n JackP[2, 1] + JackP[3]\n sage: J(0).omega()\n 0\n sage: J(1).omega()\n JackP[]\n\n The forgotten symmetric functions are the images of the monomial\n symmetric functions under omega::\n\n sage: Sym = SymmetricFunctions(ZZ)\n sage: m = Sym.m()\n sage: f = Sym.f()\n sage: all( f(lam) == m(lam).omega() for lam in Partitions(3) )\n True\n sage: all( m(lam) == f(lam).omega() for lam in Partitions(3) )\n True\n ' parent = self.parent() s = parent.realization_of().schur() return parent(s(self).omega())<|docstring|>Return the image of ``self`` under the omega automorphism. The omega automorphism is defined to be the unique algebra endomorphism `\omega` of the ring of symmetric functions that satisfies `\omega(e_k) = h_k` for all positive integers `k` (where `e_k` stands for the `k`-th elementary symmetric function, and `h_k` stands for the `k`-th complete homogeneous symmetric function). It furthermore is a Hopf algebra endomorphism, and sends the power-sum symmetric function `p_k` to `(-1)^{k-1} p_k` for every positive integer `k`. The default implementation converts to the Schurs, then performs the automorphism and changes back. EXAMPLES:: sage: J = SymmetricFunctions(QQ).jack(t=1).P() sage: a = J([2,1]) + J([1,1,1]) sage: a.omega() JackP[2, 1] + JackP[3] sage: J(0).omega() 0 sage: J(1).omega() JackP[] The forgotten symmetric functions are the images of the monomial symmetric functions under omega:: sage: Sym = SymmetricFunctions(ZZ) sage: m = Sym.m() sage: f = Sym.f() sage: all( f(lam) == m(lam).omega() for lam in Partitions(3) ) True sage: all( m(lam) == f(lam).omega() for lam in Partitions(3) ) True<|endoftext|>
a814f2aeb1711d7a653287bdcf5836ce467807e11256e2d079b9ceb730dbf1da
def theta(self, a): '\n Return the image of ``self`` under the theta endomorphism which sends\n `p_k` to `a \\cdot p_k` for every positive integer `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``a`` -- an element of the base ring\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s([2,1]).theta(2)\n 2*s[1, 1, 1] + 6*s[2, 1] + 2*s[3]\n sage: p = SymmetricFunctions(QQ).p()\n sage: p([2]).theta(2)\n 2*p[2]\n sage: p(0).theta(2)\n 0\n sage: p(1).theta(2)\n p[]\n ' p = self.parent().realization_of().power() p_self = p(self) res = p_self.map_item((lambda m, c: (m, (c * (a ** len(m)))))) return self.parent()(res)
Return the image of ``self`` under the theta endomorphism which sends `p_k` to `a \cdot p_k` for every positive integer `k`. In general, this is well-defined outside of the powersum basis only if the base ring is a `\QQ`-algebra. INPUT: - ``a`` -- an element of the base ring EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: s([2,1]).theta(2) 2*s[1, 1, 1] + 6*s[2, 1] + 2*s[3] sage: p = SymmetricFunctions(QQ).p() sage: p([2]).theta(2) 2*p[2] sage: p(0).theta(2) 0 sage: p(1).theta(2) p[]
src/sage/combinat/sf/sfa.py
theta
bopopescu/sagesmc
5
python
def theta(self, a): '\n Return the image of ``self`` under the theta endomorphism which sends\n `p_k` to `a \\cdot p_k` for every positive integer `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``a`` -- an element of the base ring\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s([2,1]).theta(2)\n 2*s[1, 1, 1] + 6*s[2, 1] + 2*s[3]\n sage: p = SymmetricFunctions(QQ).p()\n sage: p([2]).theta(2)\n 2*p[2]\n sage: p(0).theta(2)\n 0\n sage: p(1).theta(2)\n p[]\n ' p = self.parent().realization_of().power() p_self = p(self) res = p_self.map_item((lambda m, c: (m, (c * (a ** len(m)))))) return self.parent()(res)
def theta(self, a): '\n Return the image of ``self`` under the theta endomorphism which sends\n `p_k` to `a \\cdot p_k` for every positive integer `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``a`` -- an element of the base ring\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: s([2,1]).theta(2)\n 2*s[1, 1, 1] + 6*s[2, 1] + 2*s[3]\n sage: p = SymmetricFunctions(QQ).p()\n sage: p([2]).theta(2)\n 2*p[2]\n sage: p(0).theta(2)\n 0\n sage: p(1).theta(2)\n p[]\n ' p = self.parent().realization_of().power() p_self = p(self) res = p_self.map_item((lambda m, c: (m, (c * (a ** len(m)))))) return self.parent()(res)<|docstring|>Return the image of ``self`` under the theta endomorphism which sends `p_k` to `a \cdot p_k` for every positive integer `k`. In general, this is well-defined outside of the powersum basis only if the base ring is a `\QQ`-algebra. INPUT: - ``a`` -- an element of the base ring EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: s([2,1]).theta(2) 2*s[1, 1, 1] + 6*s[2, 1] + 2*s[3] sage: p = SymmetricFunctions(QQ).p() sage: p([2]).theta(2) 2*p[2] sage: p(0).theta(2) 0 sage: p(1).theta(2) p[]<|endoftext|>
e6bf47771e20526b4ef93ce2c061ae01b7eb47bac00b7f68168fd89d990a06ea
def theta_qt(self, q=None, t=None): "\n Return the image of ``self`` under the `q,t`-deformed theta\n endomorphism which sends `p_k` to `\\frac{1-q^k}{1-t^k} \\cdot p_k`\n for all positive integers `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``q``, ``t`` -- parameters (default: ``None``, in which case 'q'\n and 't' are used)\n\n EXAMPLES::\n\n sage: QQqt = QQ['q,t'].fraction_field()\n sage: q,t = QQqt.gens()\n sage: p = SymmetricFunctions(QQqt).p()\n sage: p([2]).theta_qt(q,t)\n ((-q^2+1)/(-t^2+1))*p[2]\n sage: p([2,1]).theta_qt(q,t)\n ((q^3-q^2-q+1)/(t^3-t^2-t+1))*p[2, 1]\n sage: p(0).theta_qt(q=1,t=3)\n 0\n sage: p([2,1]).theta_qt(q=2,t=3)\n 3/16*p[2, 1]\n sage: s = p.realization_of().schur()\n sage: s([3]).theta_qt(q=0)*(1-t)*(1-t^2)*(1-t^3)\n t^3*s[1, 1, 1] + (t^2+t)*s[2, 1] + s[3]\n sage: p(1).theta_qt()\n p[]\n " parent = self.parent() BR = parent.base_ring() p = parent.realization_of().power() p_self = p(self) if (t is None): if hasattr(parent, 't'): t = parent.t else: t = BR(QQ['t'].gen()) if (q is None): if hasattr(parent, 'q'): q = parent.q else: q = BR(QQ['q'].gen()) res = p_self.map_item((lambda m, c: (m, BR((prod([((1 - (q ** k)) / (1 - (t ** k))) for k in m]) * c))))) return parent(res)
Return the image of ``self`` under the `q,t`-deformed theta endomorphism which sends `p_k` to `\frac{1-q^k}{1-t^k} \cdot p_k` for all positive integers `k`. In general, this is well-defined outside of the powersum basis only if the base ring is a `\QQ`-algebra. INPUT: - ``q``, ``t`` -- parameters (default: ``None``, in which case 'q' and 't' are used) EXAMPLES:: sage: QQqt = QQ['q,t'].fraction_field() sage: q,t = QQqt.gens() sage: p = SymmetricFunctions(QQqt).p() sage: p([2]).theta_qt(q,t) ((-q^2+1)/(-t^2+1))*p[2] sage: p([2,1]).theta_qt(q,t) ((q^3-q^2-q+1)/(t^3-t^2-t+1))*p[2, 1] sage: p(0).theta_qt(q=1,t=3) 0 sage: p([2,1]).theta_qt(q=2,t=3) 3/16*p[2, 1] sage: s = p.realization_of().schur() sage: s([3]).theta_qt(q=0)*(1-t)*(1-t^2)*(1-t^3) t^3*s[1, 1, 1] + (t^2+t)*s[2, 1] + s[3] sage: p(1).theta_qt() p[]
src/sage/combinat/sf/sfa.py
theta_qt
bopopescu/sagesmc
5
python
def theta_qt(self, q=None, t=None): "\n Return the image of ``self`` under the `q,t`-deformed theta\n endomorphism which sends `p_k` to `\\frac{1-q^k}{1-t^k} \\cdot p_k`\n for all positive integers `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``q``, ``t`` -- parameters (default: ``None``, in which case 'q'\n and 't' are used)\n\n EXAMPLES::\n\n sage: QQqt = QQ['q,t'].fraction_field()\n sage: q,t = QQqt.gens()\n sage: p = SymmetricFunctions(QQqt).p()\n sage: p([2]).theta_qt(q,t)\n ((-q^2+1)/(-t^2+1))*p[2]\n sage: p([2,1]).theta_qt(q,t)\n ((q^3-q^2-q+1)/(t^3-t^2-t+1))*p[2, 1]\n sage: p(0).theta_qt(q=1,t=3)\n 0\n sage: p([2,1]).theta_qt(q=2,t=3)\n 3/16*p[2, 1]\n sage: s = p.realization_of().schur()\n sage: s([3]).theta_qt(q=0)*(1-t)*(1-t^2)*(1-t^3)\n t^3*s[1, 1, 1] + (t^2+t)*s[2, 1] + s[3]\n sage: p(1).theta_qt()\n p[]\n " parent = self.parent() BR = parent.base_ring() p = parent.realization_of().power() p_self = p(self) if (t is None): if hasattr(parent, 't'): t = parent.t else: t = BR(QQ['t'].gen()) if (q is None): if hasattr(parent, 'q'): q = parent.q else: q = BR(QQ['q'].gen()) res = p_self.map_item((lambda m, c: (m, BR((prod([((1 - (q ** k)) / (1 - (t ** k))) for k in m]) * c))))) return parent(res)
def theta_qt(self, q=None, t=None): "\n Return the image of ``self`` under the `q,t`-deformed theta\n endomorphism which sends `p_k` to `\\frac{1-q^k}{1-t^k} \\cdot p_k`\n for all positive integers `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``q``, ``t`` -- parameters (default: ``None``, in which case 'q'\n and 't' are used)\n\n EXAMPLES::\n\n sage: QQqt = QQ['q,t'].fraction_field()\n sage: q,t = QQqt.gens()\n sage: p = SymmetricFunctions(QQqt).p()\n sage: p([2]).theta_qt(q,t)\n ((-q^2+1)/(-t^2+1))*p[2]\n sage: p([2,1]).theta_qt(q,t)\n ((q^3-q^2-q+1)/(t^3-t^2-t+1))*p[2, 1]\n sage: p(0).theta_qt(q=1,t=3)\n 0\n sage: p([2,1]).theta_qt(q=2,t=3)\n 3/16*p[2, 1]\n sage: s = p.realization_of().schur()\n sage: s([3]).theta_qt(q=0)*(1-t)*(1-t^2)*(1-t^3)\n t^3*s[1, 1, 1] + (t^2+t)*s[2, 1] + s[3]\n sage: p(1).theta_qt()\n p[]\n " parent = self.parent() BR = parent.base_ring() p = parent.realization_of().power() p_self = p(self) if (t is None): if hasattr(parent, 't'): t = parent.t else: t = BR(QQ['t'].gen()) if (q is None): if hasattr(parent, 'q'): q = parent.q else: q = BR(QQ['q'].gen()) res = p_self.map_item((lambda m, c: (m, BR((prod([((1 - (q ** k)) / (1 - (t ** k))) for k in m]) * c))))) return parent(res)<|docstring|>Return the image of ``self`` under the `q,t`-deformed theta endomorphism which sends `p_k` to `\frac{1-q^k}{1-t^k} \cdot p_k` for all positive integers `k`. In general, this is well-defined outside of the powersum basis only if the base ring is a `\QQ`-algebra. INPUT: - ``q``, ``t`` -- parameters (default: ``None``, in which case 'q' and 't' are used) EXAMPLES:: sage: QQqt = QQ['q,t'].fraction_field() sage: q,t = QQqt.gens() sage: p = SymmetricFunctions(QQqt).p() sage: p([2]).theta_qt(q,t) ((-q^2+1)/(-t^2+1))*p[2] sage: p([2,1]).theta_qt(q,t) ((q^3-q^2-q+1)/(t^3-t^2-t+1))*p[2, 1] sage: p(0).theta_qt(q=1,t=3) 0 sage: p([2,1]).theta_qt(q=2,t=3) 3/16*p[2, 1] sage: s = p.realization_of().schur() sage: s([3]).theta_qt(q=0)*(1-t)*(1-t^2)*(1-t^3) t^3*s[1, 1, 1] + (t^2+t)*s[2, 1] + s[3] sage: p(1).theta_qt() p[]<|endoftext|>
04ad706e01d532725f66dfd7d0c4d0c1fd1e941bddce1d2005c3213ab26e8e9f
def omega_qt(self, q=None, t=None): "\n Return the image of ``self`` under the `q,t`-deformed omega\n automorphism which sends `p_k` to\n `(-1)^{k-1} \\cdot \\frac{1-q^k}{1-t^k} \\cdot p_k` for all positive\n integers `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``q``, ``t`` -- parameters (default: ``None``, in which case\n ``'q'`` and ``'t'`` are used)\n\n EXAMPLES::\n\n sage: QQqt = QQ['q,t'].fraction_field()\n sage: q,t = QQqt.gens()\n sage: p = SymmetricFunctions(QQqt).p()\n sage: p[5].omega_qt()\n ((-q^5+1)/(-t^5+1))*p[5]\n sage: p[5].omega_qt(q,t)\n ((-q^5+1)/(-t^5+1))*p[5]\n sage: p([2]).omega_qt(q,t)\n ((q^2-1)/(-t^2+1))*p[2]\n sage: p([2,1]).omega_qt(q,t)\n ((-q^3+q^2+q-1)/(t^3-t^2-t+1))*p[2, 1]\n sage: p([3,2]).omega_qt(5,q)\n -(2976/(q^5-q^3-q^2+1))*p[3, 2]\n sage: p(0).omega_qt()\n 0\n sage: p(1).omega_qt()\n p[]\n sage: H = SymmetricFunctions(QQqt).macdonald().H()\n sage: H([1,1]).omega_qt()\n ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2]\n sage: H([1,1]).omega_qt(q,t)\n ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2]\n sage: H([1,1]).omega_qt(t,q)\n ((t^3-t^2-t+1)/(q^3-q^2-q+1))*McdH[2]\n sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))\n sage: S = Sym.macdonald().S()\n sage: S([1,1]).omega_qt()\n ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] + ((-q^2*t+q*t+q-1)/(-t^3+t^2+t-1))*McdS[2]\n sage: s = Sym.schur()\n sage: s(S([1,1]).omega_qt())\n s[2]\n " parent = self.parent() BR = parent.base_ring() p = parent.realization_of().power() p_self = p(self) if (t is None): if hasattr(parent, 't'): t = parent.t else: t = BR(QQ['t'].gen()) if (q is None): if hasattr(parent, 'q'): q = parent.q else: q = BR(QQ['q'].gen()) f = (lambda part: prod([((((- 1) ** (i - 1)) * (1 - (q ** i))) / (1 - (t ** i))) for i in part])) res = p_self.map_item((lambda m, c: (m, BR((f(m) * c))))) return parent(res)
Return the image of ``self`` under the `q,t`-deformed omega automorphism which sends `p_k` to `(-1)^{k-1} \cdot \frac{1-q^k}{1-t^k} \cdot p_k` for all positive integers `k`. In general, this is well-defined outside of the powersum basis only if the base ring is a `\QQ`-algebra. INPUT: - ``q``, ``t`` -- parameters (default: ``None``, in which case ``'q'`` and ``'t'`` are used) EXAMPLES:: sage: QQqt = QQ['q,t'].fraction_field() sage: q,t = QQqt.gens() sage: p = SymmetricFunctions(QQqt).p() sage: p[5].omega_qt() ((-q^5+1)/(-t^5+1))*p[5] sage: p[5].omega_qt(q,t) ((-q^5+1)/(-t^5+1))*p[5] sage: p([2]).omega_qt(q,t) ((q^2-1)/(-t^2+1))*p[2] sage: p([2,1]).omega_qt(q,t) ((-q^3+q^2+q-1)/(t^3-t^2-t+1))*p[2, 1] sage: p([3,2]).omega_qt(5,q) -(2976/(q^5-q^3-q^2+1))*p[3, 2] sage: p(0).omega_qt() 0 sage: p(1).omega_qt() p[] sage: H = SymmetricFunctions(QQqt).macdonald().H() sage: H([1,1]).omega_qt() ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2] sage: H([1,1]).omega_qt(q,t) ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2] sage: H([1,1]).omega_qt(t,q) ((t^3-t^2-t+1)/(q^3-q^2-q+1))*McdH[2] sage: Sym = SymmetricFunctions(FractionField(QQ['q','t'])) sage: S = Sym.macdonald().S() sage: S([1,1]).omega_qt() ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] + ((-q^2*t+q*t+q-1)/(-t^3+t^2+t-1))*McdS[2] sage: s = Sym.schur() sage: s(S([1,1]).omega_qt()) s[2]
src/sage/combinat/sf/sfa.py
omega_qt
bopopescu/sagesmc
5
python
def omega_qt(self, q=None, t=None): "\n Return the image of ``self`` under the `q,t`-deformed omega\n automorphism which sends `p_k` to\n `(-1)^{k-1} \\cdot \\frac{1-q^k}{1-t^k} \\cdot p_k` for all positive\n integers `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``q``, ``t`` -- parameters (default: ``None``, in which case\n ``'q'`` and ``'t'`` are used)\n\n EXAMPLES::\n\n sage: QQqt = QQ['q,t'].fraction_field()\n sage: q,t = QQqt.gens()\n sage: p = SymmetricFunctions(QQqt).p()\n sage: p[5].omega_qt()\n ((-q^5+1)/(-t^5+1))*p[5]\n sage: p[5].omega_qt(q,t)\n ((-q^5+1)/(-t^5+1))*p[5]\n sage: p([2]).omega_qt(q,t)\n ((q^2-1)/(-t^2+1))*p[2]\n sage: p([2,1]).omega_qt(q,t)\n ((-q^3+q^2+q-1)/(t^3-t^2-t+1))*p[2, 1]\n sage: p([3,2]).omega_qt(5,q)\n -(2976/(q^5-q^3-q^2+1))*p[3, 2]\n sage: p(0).omega_qt()\n 0\n sage: p(1).omega_qt()\n p[]\n sage: H = SymmetricFunctions(QQqt).macdonald().H()\n sage: H([1,1]).omega_qt()\n ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2]\n sage: H([1,1]).omega_qt(q,t)\n ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2]\n sage: H([1,1]).omega_qt(t,q)\n ((t^3-t^2-t+1)/(q^3-q^2-q+1))*McdH[2]\n sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))\n sage: S = Sym.macdonald().S()\n sage: S([1,1]).omega_qt()\n ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] + ((-q^2*t+q*t+q-1)/(-t^3+t^2+t-1))*McdS[2]\n sage: s = Sym.schur()\n sage: s(S([1,1]).omega_qt())\n s[2]\n " parent = self.parent() BR = parent.base_ring() p = parent.realization_of().power() p_self = p(self) if (t is None): if hasattr(parent, 't'): t = parent.t else: t = BR(QQ['t'].gen()) if (q is None): if hasattr(parent, 'q'): q = parent.q else: q = BR(QQ['q'].gen()) f = (lambda part: prod([((((- 1) ** (i - 1)) * (1 - (q ** i))) / (1 - (t ** i))) for i in part])) res = p_self.map_item((lambda m, c: (m, BR((f(m) * c))))) return parent(res)
def omega_qt(self, q=None, t=None): "\n Return the image of ``self`` under the `q,t`-deformed omega\n automorphism which sends `p_k` to\n `(-1)^{k-1} \\cdot \\frac{1-q^k}{1-t^k} \\cdot p_k` for all positive\n integers `k`.\n\n In general, this is well-defined outside of the powersum basis only\n if the base ring is a `\\QQ`-algebra.\n\n INPUT:\n\n - ``q``, ``t`` -- parameters (default: ``None``, in which case\n ``'q'`` and ``'t'`` are used)\n\n EXAMPLES::\n\n sage: QQqt = QQ['q,t'].fraction_field()\n sage: q,t = QQqt.gens()\n sage: p = SymmetricFunctions(QQqt).p()\n sage: p[5].omega_qt()\n ((-q^5+1)/(-t^5+1))*p[5]\n sage: p[5].omega_qt(q,t)\n ((-q^5+1)/(-t^5+1))*p[5]\n sage: p([2]).omega_qt(q,t)\n ((q^2-1)/(-t^2+1))*p[2]\n sage: p([2,1]).omega_qt(q,t)\n ((-q^3+q^2+q-1)/(t^3-t^2-t+1))*p[2, 1]\n sage: p([3,2]).omega_qt(5,q)\n -(2976/(q^5-q^3-q^2+1))*p[3, 2]\n sage: p(0).omega_qt()\n 0\n sage: p(1).omega_qt()\n p[]\n sage: H = SymmetricFunctions(QQqt).macdonald().H()\n sage: H([1,1]).omega_qt()\n ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2]\n sage: H([1,1]).omega_qt(q,t)\n ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2]\n sage: H([1,1]).omega_qt(t,q)\n ((t^3-t^2-t+1)/(q^3-q^2-q+1))*McdH[2]\n sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))\n sage: S = Sym.macdonald().S()\n sage: S([1,1]).omega_qt()\n ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] + ((-q^2*t+q*t+q-1)/(-t^3+t^2+t-1))*McdS[2]\n sage: s = Sym.schur()\n sage: s(S([1,1]).omega_qt())\n s[2]\n " parent = self.parent() BR = parent.base_ring() p = parent.realization_of().power() p_self = p(self) if (t is None): if hasattr(parent, 't'): t = parent.t else: t = BR(QQ['t'].gen()) if (q is None): if hasattr(parent, 'q'): q = parent.q else: q = BR(QQ['q'].gen()) f = (lambda part: prod([((((- 1) ** (i - 1)) * (1 - (q ** i))) / (1 - (t ** i))) for i in part])) res = p_self.map_item((lambda m, c: (m, BR((f(m) * c))))) return parent(res)<|docstring|>Return the image of ``self`` under the `q,t`-deformed omega automorphism which sends `p_k` to `(-1)^{k-1} \cdot \frac{1-q^k}{1-t^k} \cdot p_k` for all positive integers `k`. In general, this is well-defined outside of the powersum basis only if the base ring is a `\QQ`-algebra. INPUT: - ``q``, ``t`` -- parameters (default: ``None``, in which case ``'q'`` and ``'t'`` are used) EXAMPLES:: sage: QQqt = QQ['q,t'].fraction_field() sage: q,t = QQqt.gens() sage: p = SymmetricFunctions(QQqt).p() sage: p[5].omega_qt() ((-q^5+1)/(-t^5+1))*p[5] sage: p[5].omega_qt(q,t) ((-q^5+1)/(-t^5+1))*p[5] sage: p([2]).omega_qt(q,t) ((q^2-1)/(-t^2+1))*p[2] sage: p([2,1]).omega_qt(q,t) ((-q^3+q^2+q-1)/(t^3-t^2-t+1))*p[2, 1] sage: p([3,2]).omega_qt(5,q) -(2976/(q^5-q^3-q^2+1))*p[3, 2] sage: p(0).omega_qt() 0 sage: p(1).omega_qt() p[] sage: H = SymmetricFunctions(QQqt).macdonald().H() sage: H([1,1]).omega_qt() ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2] sage: H([1,1]).omega_qt(q,t) ((2*q^2-2*q*t-2*q+2*t)/(t^3-t^2-t+1))*McdH[1, 1] + ((q-1)/(t-1))*McdH[2] sage: H([1,1]).omega_qt(t,q) ((t^3-t^2-t+1)/(q^3-q^2-q+1))*McdH[2] sage: Sym = SymmetricFunctions(FractionField(QQ['q','t'])) sage: S = Sym.macdonald().S() sage: S([1,1]).omega_qt() ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] + ((-q^2*t+q*t+q-1)/(-t^3+t^2+t-1))*McdS[2] sage: s = Sym.schur() sage: s(S([1,1]).omega_qt()) s[2]<|endoftext|>
d97af1ea0777b2be914c6749fe9df924504d6a352068e40b7d464652ec8f7aa7
def itensor(self, x): '\n Return the internal (tensor) product of ``self`` and ``x`` in the\n basis of ``self``.\n\n The internal tensor product can be defined as the linear extension\n of the definition on power sums\n `p_{\\lambda} \\ast p_{\\mu} = \\delta_{\\lambda,\\mu} z_{\\lambda}\n p_{\\lambda}`, where `z_{\\lambda} = (1^{r_1} r_1!) (2^{r_2} r_2!)\n \\cdots` for `\\lambda = (1^{r_1} 2^{r_2} \\cdots )` and where `\\ast`\n denotes the internal tensor product.\n The internal tensor product is also known as the Kronecker product,\n or as the second multiplication on the ring of symmetric functions.\n\n Note that the internal product of any two homogeneous symmetric\n functions of equal degrees is a homogeneous symmetric function of the\n same degree. On the other hand, the internal product of two homogeneous\n symmetric functions of distinct degrees is `0`.\n\n .. NOTE::\n\n The internal product is sometimes referred to as "inner product"\n in the literature, but unfortunately this name is shared by a\n different operation, namely the Hall inner product\n (see :meth:`scalar`).\n\n INPUT:\n\n - ``x`` -- element of the ring of symmetric functions over the\n same base ring as ``self``\n\n OUTPUT:\n\n - the internal product of ``self`` with ``x`` (an element of the\n ring of symmetric functions in the same basis as ``self``)\n\n The methods :meth:`itensor`, :meth:`internal_product`,\n :meth:`kronecker_product`, :meth:`inner_tensor` are all\n synonyms.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([2,1])\n sage: b = s([3])\n sage: a.itensor(b)\n s[2, 1]\n sage: c = s([3,2,1])\n sage: c.itensor(c)\n s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6]\n\n There are few quantitative results pertaining to Kronecker products\n in general, which makes their computation so difficult. Let us test\n a few of them in different bases.\n\n The Kronecker product of any homogeneous symmetric function `f` of\n degree `n` with the `n`-th complete homogeneous symmetric function\n ``h[n]`` (a.k.a. ``s[n]``) is `f`::\n\n sage: h = SymmetricFunctions(ZZ).h()\n sage: all( h([5]).itensor(h(p)) == h(p) for p in Partitions(5) )\n True\n\n The Kronecker product of a Schur function `s_{\\lambda}` with the `n`-th\n elementary symmetric function ``e[n]``, where `n = \\left| \\lambda\n \\right|`, is `s_{\\lambda\'}` (where `\\lambda\'` is the conjugate\n partition of `\\lambda`)::\n\n sage: F = CyclotomicField(12)\n sage: s = SymmetricFunctions(F).s()\n sage: e = SymmetricFunctions(F).e()\n sage: all( e([5]).itensor(s(p)) == s(p.conjugate()) for p in Partitions(5) )\n True\n\n The Kronecker product is commutative::\n\n sage: e = SymmetricFunctions(FiniteField(19)).e()\n sage: m = SymmetricFunctions(FiniteField(19)).m()\n sage: all( all( e(p).itensor(m(q)) == m(q).itensor(e(p)) for q in Partitions(4) )\n ....: for p in Partitions(4) )\n True\n\n sage: F = FractionField(QQ[\'q\',\'t\'])\n sage: mq = SymmetricFunctions(F).macdonald().Q()\n sage: mh = SymmetricFunctions(F).macdonald().H()\n sage: all( all( mq(p).itensor(mh(r)) == mh(r).itensor(mq(p)) for r in Partitions(4) )\n ....: for p in Partitions(3) ) # long time\n True\n\n Let us check (on examples) Proposition 5.2 of Gelfand, Krob, Lascoux, Leclerc,\n Retakh, Thibon, "Noncommutative symmetric functions", :arXiv:`hep-th/9407124`, for\n `r = 2`::\n\n sage: e = SymmetricFunctions(FiniteField(29)).e()\n sage: s = SymmetricFunctions(FiniteField(29)).s()\n sage: m = SymmetricFunctions(FiniteField(29)).m()\n sage: def tensor_copr(u, v, w): # computes \\mu ((u \\otimes v) * \\Delta(w)) with\n ....: # * meaning Kronecker product and \\mu meaning the\n ....: # usual multiplication.\n ....: result = w.parent().zero()\n ....: for partition_pair, coeff in w.coproduct().monomial_coefficients().iteritems():\n ....: result += coeff * w.parent()(u).itensor(partition_pair[0]) * w.parent()(v).itensor(partition_pair[1])\n ....: return result\n sage: all( all( all( tensor_copr(e[u], s[v], m[w]) == (e[u] * s[v]).itensor(m[w])\n ....: for w in Partitions(5) )\n ....: for v in Partitions(2) )\n ....: for u in Partitions(3) ) # long time\n True\n\n Some examples from Briand, Orellana, Rosas, "The stability of the Kronecker\n products of Schur functions." :arXiv:`0907.4652`::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: s[2,2].itensor(s[2,2])\n s[1, 1, 1, 1] + s[2, 2] + s[4]\n sage: s[3,2].itensor(s[3,2])\n s[2, 1, 1, 1] + s[2, 2, 1] + s[3, 1, 1] + s[3, 2] + s[4, 1] + s[5]\n sage: s[4,2].itensor(s[4,2])\n s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1] + s[4, 1, 1] + 2*s[4, 2] + s[5, 1] + s[6]\n\n An example from p. 220 of Thibon, "Hopf algebras of symmetric functions\n and tensor products of symmetric group representations", International\n Journal of Algebra and Computation, 0000:0000:0000:0000:0000:0000:0000:0000\n\n sage: s = SymmetricFunctions(QQbar).s()\n sage: s[2,1].itensor(s[2,1])\n s[1, 1, 1] + s[2, 1] + s[3]\n\n TESTS::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([8,8])\n sage: a.itensor(a)\n s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]\n sage: s[8].itensor(s[7])\n 0\n sage: s(0).itensor(s(0))\n 0\n sage: s(1).itensor(s(0))\n 0\n sage: s(0).itensor(s(1))\n 0\n sage: s(1).itensor(s(1))\n s[]\n\n Same over the ring of integers::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: a = s([8,8])\n sage: a.itensor(a)\n s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]\n sage: s[8].itensor(s[7])\n 0\n sage: s(0).itensor(s(0))\n 0\n sage: s(1).itensor(s(0))\n 0\n sage: s(0).itensor(s(1))\n 0\n sage: s(1).itensor(s(1))\n s[]\n\n Theorem 2.1 in Bessenrodt, van Willigenburg, :arXiv:`1105.3170v2`::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: all( all( max( r[0] for r in s(p).itensor(s(q)).monomial_coefficients().keys() )\n ....: == sum( min(p[i], q.get_part(i)) for i in range(len(p)) )\n ....: for p in Partitions(4) )\n ....: for q in Partitions(4) )\n True\n sage: all( all( max( len(r) for r in s(p).itensor(s(q)).monomial_coefficients().keys() )\n ....: == sum( min(p[i], q.conjugate().get_part(i)) for i in range(len(p)) )\n ....: for p in Partitions(4) )\n ....: for q in Partitions(4) )\n True\n\n Check that the basis and ground ring of ``self`` are preserved::\n\n sage: F = CyclotomicField(12)\n sage: s = SymmetricFunctions(F).s()\n sage: e = SymmetricFunctions(F).e()\n sage: e[3].itensor(s[3])\n e[3]\n sage: s[3].itensor(e[3])\n s[1, 1, 1]\n sage: parent(e[3].itensor(s[3]))\n Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the elementary basis\n sage: parent(s[3].itensor(e[3]))\n Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the Schur basis\n\n .. NOTE::\n\n The currently existing implementation of this function is\n technically unsatisfactory. It distinguishes the case when the\n base ring is a `\\QQ`-algebra (in which case the Kronecker product\n can be easily computed using the power sum basis) from the case\n where it isn\'t. In the latter, it does a computation using\n universal coefficients, again distinguishing the case when it is\n able to compute the "corresponding" basis of the symmetric function\n algebra over `\\QQ` (using the ``corresponding_basis_over`` hack)\n from the case when it isn\'t (in which case it transforms everything\n into the Schur basis, which is slow).\n ' parent = self.parent() if parent.has_coerce_map_from(QQ): p = parent.realization_of().power() f = (lambda part1, part2: (zee(part1) * p(part1))) return parent(p._apply_multi_module_morphism(p(self), p(x), f, orthogonal=True)) else: comp_parent = parent comp_self = self corresponding_parent_over_QQ = parent.corresponding_basis_over(QQ) if (corresponding_parent_over_QQ is None): comp_parent = parent.realization_of().schur() comp_self = comp_parent(self) from sage.combinat.sf.sf import SymmetricFunctions corresponding_parent_over_QQ = SymmetricFunctions(QQ).schur() comp_x = comp_parent(x) result = comp_parent.zero() for (lam, a) in comp_self.monomial_coefficients().items(): for (mu, b) in comp_x.monomial_coefficients().items(): lam_star_mu = corresponding_parent_over_QQ(lam).itensor(corresponding_parent_over_QQ(mu)) for (nu, c) in lam_star_mu.monomial_coefficients().items(): result += (((a * b) * comp_parent.base_ring()(c)) * comp_parent(nu)) return parent(result)
Return the internal (tensor) product of ``self`` and ``x`` in the basis of ``self``. The internal tensor product can be defined as the linear extension of the definition on power sums `p_{\lambda} \ast p_{\mu} = \delta_{\lambda,\mu} z_{\lambda} p_{\lambda}`, where `z_{\lambda} = (1^{r_1} r_1!) (2^{r_2} r_2!) \cdots` for `\lambda = (1^{r_1} 2^{r_2} \cdots )` and where `\ast` denotes the internal tensor product. The internal tensor product is also known as the Kronecker product, or as the second multiplication on the ring of symmetric functions. Note that the internal product of any two homogeneous symmetric functions of equal degrees is a homogeneous symmetric function of the same degree. On the other hand, the internal product of two homogeneous symmetric functions of distinct degrees is `0`. .. NOTE:: The internal product is sometimes referred to as "inner product" in the literature, but unfortunately this name is shared by a different operation, namely the Hall inner product (see :meth:`scalar`). INPUT: - ``x`` -- element of the ring of symmetric functions over the same base ring as ``self`` OUTPUT: - the internal product of ``self`` with ``x`` (an element of the ring of symmetric functions in the same basis as ``self``) The methods :meth:`itensor`, :meth:`internal_product`, :meth:`kronecker_product`, :meth:`inner_tensor` are all synonyms. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: a = s([2,1]) sage: b = s([3]) sage: a.itensor(b) s[2, 1] sage: c = s([3,2,1]) sage: c.itensor(c) s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6] There are few quantitative results pertaining to Kronecker products in general, which makes their computation so difficult. Let us test a few of them in different bases. The Kronecker product of any homogeneous symmetric function `f` of degree `n` with the `n`-th complete homogeneous symmetric function ``h[n]`` (a.k.a. ``s[n]``) is `f`:: sage: h = SymmetricFunctions(ZZ).h() sage: all( h([5]).itensor(h(p)) == h(p) for p in Partitions(5) ) True The Kronecker product of a Schur function `s_{\lambda}` with the `n`-th elementary symmetric function ``e[n]``, where `n = \left| \lambda \right|`, is `s_{\lambda'}` (where `\lambda'` is the conjugate partition of `\lambda`):: sage: F = CyclotomicField(12) sage: s = SymmetricFunctions(F).s() sage: e = SymmetricFunctions(F).e() sage: all( e([5]).itensor(s(p)) == s(p.conjugate()) for p in Partitions(5) ) True The Kronecker product is commutative:: sage: e = SymmetricFunctions(FiniteField(19)).e() sage: m = SymmetricFunctions(FiniteField(19)).m() sage: all( all( e(p).itensor(m(q)) == m(q).itensor(e(p)) for q in Partitions(4) ) ....: for p in Partitions(4) ) True sage: F = FractionField(QQ['q','t']) sage: mq = SymmetricFunctions(F).macdonald().Q() sage: mh = SymmetricFunctions(F).macdonald().H() sage: all( all( mq(p).itensor(mh(r)) == mh(r).itensor(mq(p)) for r in Partitions(4) ) ....: for p in Partitions(3) ) # long time True Let us check (on examples) Proposition 5.2 of Gelfand, Krob, Lascoux, Leclerc, Retakh, Thibon, "Noncommutative symmetric functions", :arXiv:`hep-th/9407124`, for `r = 2`:: sage: e = SymmetricFunctions(FiniteField(29)).e() sage: s = SymmetricFunctions(FiniteField(29)).s() sage: m = SymmetricFunctions(FiniteField(29)).m() sage: def tensor_copr(u, v, w): # computes \mu ((u \otimes v) * \Delta(w)) with ....: # * meaning Kronecker product and \mu meaning the ....: # usual multiplication. ....: result = w.parent().zero() ....: for partition_pair, coeff in w.coproduct().monomial_coefficients().iteritems(): ....: result += coeff * w.parent()(u).itensor(partition_pair[0]) * w.parent()(v).itensor(partition_pair[1]) ....: return result sage: all( all( all( tensor_copr(e[u], s[v], m[w]) == (e[u] * s[v]).itensor(m[w]) ....: for w in Partitions(5) ) ....: for v in Partitions(2) ) ....: for u in Partitions(3) ) # long time True Some examples from Briand, Orellana, Rosas, "The stability of the Kronecker products of Schur functions." :arXiv:`0907.4652`:: sage: s = SymmetricFunctions(ZZ).s() sage: s[2,2].itensor(s[2,2]) s[1, 1, 1, 1] + s[2, 2] + s[4] sage: s[3,2].itensor(s[3,2]) s[2, 1, 1, 1] + s[2, 2, 1] + s[3, 1, 1] + s[3, 2] + s[4, 1] + s[5] sage: s[4,2].itensor(s[4,2]) s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1] + s[4, 1, 1] + 2*s[4, 2] + s[5, 1] + s[6] An example from p. 220 of Thibon, "Hopf algebras of symmetric functions and tensor products of symmetric group representations", International Journal of Algebra and Computation, 0000:0000:0000:0000:0000:0000:0000:0000 sage: s = SymmetricFunctions(QQbar).s() sage: s[2,1].itensor(s[2,1]) s[1, 1, 1] + s[2, 1] + s[3] TESTS:: sage: s = SymmetricFunctions(QQ).s() sage: a = s([8,8]) sage: a.itensor(a) s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16] sage: s[8].itensor(s[7]) 0 sage: s(0).itensor(s(0)) 0 sage: s(1).itensor(s(0)) 0 sage: s(0).itensor(s(1)) 0 sage: s(1).itensor(s(1)) s[] Same over the ring of integers:: sage: s = SymmetricFunctions(ZZ).s() sage: a = s([8,8]) sage: a.itensor(a) s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16] sage: s[8].itensor(s[7]) 0 sage: s(0).itensor(s(0)) 0 sage: s(1).itensor(s(0)) 0 sage: s(0).itensor(s(1)) 0 sage: s(1).itensor(s(1)) s[] Theorem 2.1 in Bessenrodt, van Willigenburg, :arXiv:`1105.3170v2`:: sage: s = SymmetricFunctions(ZZ).s() sage: all( all( max( r[0] for r in s(p).itensor(s(q)).monomial_coefficients().keys() ) ....: == sum( min(p[i], q.get_part(i)) for i in range(len(p)) ) ....: for p in Partitions(4) ) ....: for q in Partitions(4) ) True sage: all( all( max( len(r) for r in s(p).itensor(s(q)).monomial_coefficients().keys() ) ....: == sum( min(p[i], q.conjugate().get_part(i)) for i in range(len(p)) ) ....: for p in Partitions(4) ) ....: for q in Partitions(4) ) True Check that the basis and ground ring of ``self`` are preserved:: sage: F = CyclotomicField(12) sage: s = SymmetricFunctions(F).s() sage: e = SymmetricFunctions(F).e() sage: e[3].itensor(s[3]) e[3] sage: s[3].itensor(e[3]) s[1, 1, 1] sage: parent(e[3].itensor(s[3])) Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the elementary basis sage: parent(s[3].itensor(e[3])) Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the Schur basis .. NOTE:: The currently existing implementation of this function is technically unsatisfactory. It distinguishes the case when the base ring is a `\QQ`-algebra (in which case the Kronecker product can be easily computed using the power sum basis) from the case where it isn't. In the latter, it does a computation using universal coefficients, again distinguishing the case when it is able to compute the "corresponding" basis of the symmetric function algebra over `\QQ` (using the ``corresponding_basis_over`` hack) from the case when it isn't (in which case it transforms everything into the Schur basis, which is slow).
src/sage/combinat/sf/sfa.py
itensor
bopopescu/sagesmc
5
python
def itensor(self, x): '\n Return the internal (tensor) product of ``self`` and ``x`` in the\n basis of ``self``.\n\n The internal tensor product can be defined as the linear extension\n of the definition on power sums\n `p_{\\lambda} \\ast p_{\\mu} = \\delta_{\\lambda,\\mu} z_{\\lambda}\n p_{\\lambda}`, where `z_{\\lambda} = (1^{r_1} r_1!) (2^{r_2} r_2!)\n \\cdots` for `\\lambda = (1^{r_1} 2^{r_2} \\cdots )` and where `\\ast`\n denotes the internal tensor product.\n The internal tensor product is also known as the Kronecker product,\n or as the second multiplication on the ring of symmetric functions.\n\n Note that the internal product of any two homogeneous symmetric\n functions of equal degrees is a homogeneous symmetric function of the\n same degree. On the other hand, the internal product of two homogeneous\n symmetric functions of distinct degrees is `0`.\n\n .. NOTE::\n\n The internal product is sometimes referred to as "inner product"\n in the literature, but unfortunately this name is shared by a\n different operation, namely the Hall inner product\n (see :meth:`scalar`).\n\n INPUT:\n\n - ``x`` -- element of the ring of symmetric functions over the\n same base ring as ``self``\n\n OUTPUT:\n\n - the internal product of ``self`` with ``x`` (an element of the\n ring of symmetric functions in the same basis as ``self``)\n\n The methods :meth:`itensor`, :meth:`internal_product`,\n :meth:`kronecker_product`, :meth:`inner_tensor` are all\n synonyms.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([2,1])\n sage: b = s([3])\n sage: a.itensor(b)\n s[2, 1]\n sage: c = s([3,2,1])\n sage: c.itensor(c)\n s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6]\n\n There are few quantitative results pertaining to Kronecker products\n in general, which makes their computation so difficult. Let us test\n a few of them in different bases.\n\n The Kronecker product of any homogeneous symmetric function `f` of\n degree `n` with the `n`-th complete homogeneous symmetric function\n ``h[n]`` (a.k.a. ``s[n]``) is `f`::\n\n sage: h = SymmetricFunctions(ZZ).h()\n sage: all( h([5]).itensor(h(p)) == h(p) for p in Partitions(5) )\n True\n\n The Kronecker product of a Schur function `s_{\\lambda}` with the `n`-th\n elementary symmetric function ``e[n]``, where `n = \\left| \\lambda\n \\right|`, is `s_{\\lambda\'}` (where `\\lambda\'` is the conjugate\n partition of `\\lambda`)::\n\n sage: F = CyclotomicField(12)\n sage: s = SymmetricFunctions(F).s()\n sage: e = SymmetricFunctions(F).e()\n sage: all( e([5]).itensor(s(p)) == s(p.conjugate()) for p in Partitions(5) )\n True\n\n The Kronecker product is commutative::\n\n sage: e = SymmetricFunctions(FiniteField(19)).e()\n sage: m = SymmetricFunctions(FiniteField(19)).m()\n sage: all( all( e(p).itensor(m(q)) == m(q).itensor(e(p)) for q in Partitions(4) )\n ....: for p in Partitions(4) )\n True\n\n sage: F = FractionField(QQ[\'q\',\'t\'])\n sage: mq = SymmetricFunctions(F).macdonald().Q()\n sage: mh = SymmetricFunctions(F).macdonald().H()\n sage: all( all( mq(p).itensor(mh(r)) == mh(r).itensor(mq(p)) for r in Partitions(4) )\n ....: for p in Partitions(3) ) # long time\n True\n\n Let us check (on examples) Proposition 5.2 of Gelfand, Krob, Lascoux, Leclerc,\n Retakh, Thibon, "Noncommutative symmetric functions", :arXiv:`hep-th/9407124`, for\n `r = 2`::\n\n sage: e = SymmetricFunctions(FiniteField(29)).e()\n sage: s = SymmetricFunctions(FiniteField(29)).s()\n sage: m = SymmetricFunctions(FiniteField(29)).m()\n sage: def tensor_copr(u, v, w): # computes \\mu ((u \\otimes v) * \\Delta(w)) with\n ....: # * meaning Kronecker product and \\mu meaning the\n ....: # usual multiplication.\n ....: result = w.parent().zero()\n ....: for partition_pair, coeff in w.coproduct().monomial_coefficients().iteritems():\n ....: result += coeff * w.parent()(u).itensor(partition_pair[0]) * w.parent()(v).itensor(partition_pair[1])\n ....: return result\n sage: all( all( all( tensor_copr(e[u], s[v], m[w]) == (e[u] * s[v]).itensor(m[w])\n ....: for w in Partitions(5) )\n ....: for v in Partitions(2) )\n ....: for u in Partitions(3) ) # long time\n True\n\n Some examples from Briand, Orellana, Rosas, "The stability of the Kronecker\n products of Schur functions." :arXiv:`0907.4652`::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: s[2,2].itensor(s[2,2])\n s[1, 1, 1, 1] + s[2, 2] + s[4]\n sage: s[3,2].itensor(s[3,2])\n s[2, 1, 1, 1] + s[2, 2, 1] + s[3, 1, 1] + s[3, 2] + s[4, 1] + s[5]\n sage: s[4,2].itensor(s[4,2])\n s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1] + s[4, 1, 1] + 2*s[4, 2] + s[5, 1] + s[6]\n\n An example from p. 220 of Thibon, "Hopf algebras of symmetric functions\n and tensor products of symmetric group representations", International\n Journal of Algebra and Computation, 0000:0000:0000:0000:0000:0000:0000:0000\n\n sage: s = SymmetricFunctions(QQbar).s()\n sage: s[2,1].itensor(s[2,1])\n s[1, 1, 1] + s[2, 1] + s[3]\n\n TESTS::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([8,8])\n sage: a.itensor(a)\n s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]\n sage: s[8].itensor(s[7])\n 0\n sage: s(0).itensor(s(0))\n 0\n sage: s(1).itensor(s(0))\n 0\n sage: s(0).itensor(s(1))\n 0\n sage: s(1).itensor(s(1))\n s[]\n\n Same over the ring of integers::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: a = s([8,8])\n sage: a.itensor(a)\n s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]\n sage: s[8].itensor(s[7])\n 0\n sage: s(0).itensor(s(0))\n 0\n sage: s(1).itensor(s(0))\n 0\n sage: s(0).itensor(s(1))\n 0\n sage: s(1).itensor(s(1))\n s[]\n\n Theorem 2.1 in Bessenrodt, van Willigenburg, :arXiv:`1105.3170v2`::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: all( all( max( r[0] for r in s(p).itensor(s(q)).monomial_coefficients().keys() )\n ....: == sum( min(p[i], q.get_part(i)) for i in range(len(p)) )\n ....: for p in Partitions(4) )\n ....: for q in Partitions(4) )\n True\n sage: all( all( max( len(r) for r in s(p).itensor(s(q)).monomial_coefficients().keys() )\n ....: == sum( min(p[i], q.conjugate().get_part(i)) for i in range(len(p)) )\n ....: for p in Partitions(4) )\n ....: for q in Partitions(4) )\n True\n\n Check that the basis and ground ring of ``self`` are preserved::\n\n sage: F = CyclotomicField(12)\n sage: s = SymmetricFunctions(F).s()\n sage: e = SymmetricFunctions(F).e()\n sage: e[3].itensor(s[3])\n e[3]\n sage: s[3].itensor(e[3])\n s[1, 1, 1]\n sage: parent(e[3].itensor(s[3]))\n Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the elementary basis\n sage: parent(s[3].itensor(e[3]))\n Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the Schur basis\n\n .. NOTE::\n\n The currently existing implementation of this function is\n technically unsatisfactory. It distinguishes the case when the\n base ring is a `\\QQ`-algebra (in which case the Kronecker product\n can be easily computed using the power sum basis) from the case\n where it isn\'t. In the latter, it does a computation using\n universal coefficients, again distinguishing the case when it is\n able to compute the "corresponding" basis of the symmetric function\n algebra over `\\QQ` (using the ``corresponding_basis_over`` hack)\n from the case when it isn\'t (in which case it transforms everything\n into the Schur basis, which is slow).\n ' parent = self.parent() if parent.has_coerce_map_from(QQ): p = parent.realization_of().power() f = (lambda part1, part2: (zee(part1) * p(part1))) return parent(p._apply_multi_module_morphism(p(self), p(x), f, orthogonal=True)) else: comp_parent = parent comp_self = self corresponding_parent_over_QQ = parent.corresponding_basis_over(QQ) if (corresponding_parent_over_QQ is None): comp_parent = parent.realization_of().schur() comp_self = comp_parent(self) from sage.combinat.sf.sf import SymmetricFunctions corresponding_parent_over_QQ = SymmetricFunctions(QQ).schur() comp_x = comp_parent(x) result = comp_parent.zero() for (lam, a) in comp_self.monomial_coefficients().items(): for (mu, b) in comp_x.monomial_coefficients().items(): lam_star_mu = corresponding_parent_over_QQ(lam).itensor(corresponding_parent_over_QQ(mu)) for (nu, c) in lam_star_mu.monomial_coefficients().items(): result += (((a * b) * comp_parent.base_ring()(c)) * comp_parent(nu)) return parent(result)
def itensor(self, x): '\n Return the internal (tensor) product of ``self`` and ``x`` in the\n basis of ``self``.\n\n The internal tensor product can be defined as the linear extension\n of the definition on power sums\n `p_{\\lambda} \\ast p_{\\mu} = \\delta_{\\lambda,\\mu} z_{\\lambda}\n p_{\\lambda}`, where `z_{\\lambda} = (1^{r_1} r_1!) (2^{r_2} r_2!)\n \\cdots` for `\\lambda = (1^{r_1} 2^{r_2} \\cdots )` and where `\\ast`\n denotes the internal tensor product.\n The internal tensor product is also known as the Kronecker product,\n or as the second multiplication on the ring of symmetric functions.\n\n Note that the internal product of any two homogeneous symmetric\n functions of equal degrees is a homogeneous symmetric function of the\n same degree. On the other hand, the internal product of two homogeneous\n symmetric functions of distinct degrees is `0`.\n\n .. NOTE::\n\n The internal product is sometimes referred to as "inner product"\n in the literature, but unfortunately this name is shared by a\n different operation, namely the Hall inner product\n (see :meth:`scalar`).\n\n INPUT:\n\n - ``x`` -- element of the ring of symmetric functions over the\n same base ring as ``self``\n\n OUTPUT:\n\n - the internal product of ``self`` with ``x`` (an element of the\n ring of symmetric functions in the same basis as ``self``)\n\n The methods :meth:`itensor`, :meth:`internal_product`,\n :meth:`kronecker_product`, :meth:`inner_tensor` are all\n synonyms.\n\n EXAMPLES::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([2,1])\n sage: b = s([3])\n sage: a.itensor(b)\n s[2, 1]\n sage: c = s([3,2,1])\n sage: c.itensor(c)\n s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6]\n\n There are few quantitative results pertaining to Kronecker products\n in general, which makes their computation so difficult. Let us test\n a few of them in different bases.\n\n The Kronecker product of any homogeneous symmetric function `f` of\n degree `n` with the `n`-th complete homogeneous symmetric function\n ``h[n]`` (a.k.a. ``s[n]``) is `f`::\n\n sage: h = SymmetricFunctions(ZZ).h()\n sage: all( h([5]).itensor(h(p)) == h(p) for p in Partitions(5) )\n True\n\n The Kronecker product of a Schur function `s_{\\lambda}` with the `n`-th\n elementary symmetric function ``e[n]``, where `n = \\left| \\lambda\n \\right|`, is `s_{\\lambda\'}` (where `\\lambda\'` is the conjugate\n partition of `\\lambda`)::\n\n sage: F = CyclotomicField(12)\n sage: s = SymmetricFunctions(F).s()\n sage: e = SymmetricFunctions(F).e()\n sage: all( e([5]).itensor(s(p)) == s(p.conjugate()) for p in Partitions(5) )\n True\n\n The Kronecker product is commutative::\n\n sage: e = SymmetricFunctions(FiniteField(19)).e()\n sage: m = SymmetricFunctions(FiniteField(19)).m()\n sage: all( all( e(p).itensor(m(q)) == m(q).itensor(e(p)) for q in Partitions(4) )\n ....: for p in Partitions(4) )\n True\n\n sage: F = FractionField(QQ[\'q\',\'t\'])\n sage: mq = SymmetricFunctions(F).macdonald().Q()\n sage: mh = SymmetricFunctions(F).macdonald().H()\n sage: all( all( mq(p).itensor(mh(r)) == mh(r).itensor(mq(p)) for r in Partitions(4) )\n ....: for p in Partitions(3) ) # long time\n True\n\n Let us check (on examples) Proposition 5.2 of Gelfand, Krob, Lascoux, Leclerc,\n Retakh, Thibon, "Noncommutative symmetric functions", :arXiv:`hep-th/9407124`, for\n `r = 2`::\n\n sage: e = SymmetricFunctions(FiniteField(29)).e()\n sage: s = SymmetricFunctions(FiniteField(29)).s()\n sage: m = SymmetricFunctions(FiniteField(29)).m()\n sage: def tensor_copr(u, v, w): # computes \\mu ((u \\otimes v) * \\Delta(w)) with\n ....: # * meaning Kronecker product and \\mu meaning the\n ....: # usual multiplication.\n ....: result = w.parent().zero()\n ....: for partition_pair, coeff in w.coproduct().monomial_coefficients().iteritems():\n ....: result += coeff * w.parent()(u).itensor(partition_pair[0]) * w.parent()(v).itensor(partition_pair[1])\n ....: return result\n sage: all( all( all( tensor_copr(e[u], s[v], m[w]) == (e[u] * s[v]).itensor(m[w])\n ....: for w in Partitions(5) )\n ....: for v in Partitions(2) )\n ....: for u in Partitions(3) ) # long time\n True\n\n Some examples from Briand, Orellana, Rosas, "The stability of the Kronecker\n products of Schur functions." :arXiv:`0907.4652`::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: s[2,2].itensor(s[2,2])\n s[1, 1, 1, 1] + s[2, 2] + s[4]\n sage: s[3,2].itensor(s[3,2])\n s[2, 1, 1, 1] + s[2, 2, 1] + s[3, 1, 1] + s[3, 2] + s[4, 1] + s[5]\n sage: s[4,2].itensor(s[4,2])\n s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1] + s[4, 1, 1] + 2*s[4, 2] + s[5, 1] + s[6]\n\n An example from p. 220 of Thibon, "Hopf algebras of symmetric functions\n and tensor products of symmetric group representations", International\n Journal of Algebra and Computation, 0000:0000:0000:0000:0000:0000:0000:0000\n\n sage: s = SymmetricFunctions(QQbar).s()\n sage: s[2,1].itensor(s[2,1])\n s[1, 1, 1] + s[2, 1] + s[3]\n\n TESTS::\n\n sage: s = SymmetricFunctions(QQ).s()\n sage: a = s([8,8])\n sage: a.itensor(a)\n s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]\n sage: s[8].itensor(s[7])\n 0\n sage: s(0).itensor(s(0))\n 0\n sage: s(1).itensor(s(0))\n 0\n sage: s(0).itensor(s(1))\n 0\n sage: s(1).itensor(s(1))\n s[]\n\n Same over the ring of integers::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: a = s([8,8])\n sage: a.itensor(a)\n s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]\n sage: s[8].itensor(s[7])\n 0\n sage: s(0).itensor(s(0))\n 0\n sage: s(1).itensor(s(0))\n 0\n sage: s(0).itensor(s(1))\n 0\n sage: s(1).itensor(s(1))\n s[]\n\n Theorem 2.1 in Bessenrodt, van Willigenburg, :arXiv:`1105.3170v2`::\n\n sage: s = SymmetricFunctions(ZZ).s()\n sage: all( all( max( r[0] for r in s(p).itensor(s(q)).monomial_coefficients().keys() )\n ....: == sum( min(p[i], q.get_part(i)) for i in range(len(p)) )\n ....: for p in Partitions(4) )\n ....: for q in Partitions(4) )\n True\n sage: all( all( max( len(r) for r in s(p).itensor(s(q)).monomial_coefficients().keys() )\n ....: == sum( min(p[i], q.conjugate().get_part(i)) for i in range(len(p)) )\n ....: for p in Partitions(4) )\n ....: for q in Partitions(4) )\n True\n\n Check that the basis and ground ring of ``self`` are preserved::\n\n sage: F = CyclotomicField(12)\n sage: s = SymmetricFunctions(F).s()\n sage: e = SymmetricFunctions(F).e()\n sage: e[3].itensor(s[3])\n e[3]\n sage: s[3].itensor(e[3])\n s[1, 1, 1]\n sage: parent(e[3].itensor(s[3]))\n Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the elementary basis\n sage: parent(s[3].itensor(e[3]))\n Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the Schur basis\n\n .. NOTE::\n\n The currently existing implementation of this function is\n technically unsatisfactory. It distinguishes the case when the\n base ring is a `\\QQ`-algebra (in which case the Kronecker product\n can be easily computed using the power sum basis) from the case\n where it isn\'t. In the latter, it does a computation using\n universal coefficients, again distinguishing the case when it is\n able to compute the "corresponding" basis of the symmetric function\n algebra over `\\QQ` (using the ``corresponding_basis_over`` hack)\n from the case when it isn\'t (in which case it transforms everything\n into the Schur basis, which is slow).\n ' parent = self.parent() if parent.has_coerce_map_from(QQ): p = parent.realization_of().power() f = (lambda part1, part2: (zee(part1) * p(part1))) return parent(p._apply_multi_module_morphism(p(self), p(x), f, orthogonal=True)) else: comp_parent = parent comp_self = self corresponding_parent_over_QQ = parent.corresponding_basis_over(QQ) if (corresponding_parent_over_QQ is None): comp_parent = parent.realization_of().schur() comp_self = comp_parent(self) from sage.combinat.sf.sf import SymmetricFunctions corresponding_parent_over_QQ = SymmetricFunctions(QQ).schur() comp_x = comp_parent(x) result = comp_parent.zero() for (lam, a) in comp_self.monomial_coefficients().items(): for (mu, b) in comp_x.monomial_coefficients().items(): lam_star_mu = corresponding_parent_over_QQ(lam).itensor(corresponding_parent_over_QQ(mu)) for (nu, c) in lam_star_mu.monomial_coefficients().items(): result += (((a * b) * comp_parent.base_ring()(c)) * comp_parent(nu)) return parent(result)<|docstring|>Return the internal (tensor) product of ``self`` and ``x`` in the basis of ``self``. The internal tensor product can be defined as the linear extension of the definition on power sums `p_{\lambda} \ast p_{\mu} = \delta_{\lambda,\mu} z_{\lambda} p_{\lambda}`, where `z_{\lambda} = (1^{r_1} r_1!) (2^{r_2} r_2!) \cdots` for `\lambda = (1^{r_1} 2^{r_2} \cdots )` and where `\ast` denotes the internal tensor product. The internal tensor product is also known as the Kronecker product, or as the second multiplication on the ring of symmetric functions. Note that the internal product of any two homogeneous symmetric functions of equal degrees is a homogeneous symmetric function of the same degree. On the other hand, the internal product of two homogeneous symmetric functions of distinct degrees is `0`. .. NOTE:: The internal product is sometimes referred to as "inner product" in the literature, but unfortunately this name is shared by a different operation, namely the Hall inner product (see :meth:`scalar`). INPUT: - ``x`` -- element of the ring of symmetric functions over the same base ring as ``self`` OUTPUT: - the internal product of ``self`` with ``x`` (an element of the ring of symmetric functions in the same basis as ``self``) The methods :meth:`itensor`, :meth:`internal_product`, :meth:`kronecker_product`, :meth:`inner_tensor` are all synonyms. EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() sage: a = s([2,1]) sage: b = s([3]) sage: a.itensor(b) s[2, 1] sage: c = s([3,2,1]) sage: c.itensor(c) s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6] There are few quantitative results pertaining to Kronecker products in general, which makes their computation so difficult. Let us test a few of them in different bases. The Kronecker product of any homogeneous symmetric function `f` of degree `n` with the `n`-th complete homogeneous symmetric function ``h[n]`` (a.k.a. ``s[n]``) is `f`:: sage: h = SymmetricFunctions(ZZ).h() sage: all( h([5]).itensor(h(p)) == h(p) for p in Partitions(5) ) True The Kronecker product of a Schur function `s_{\lambda}` with the `n`-th elementary symmetric function ``e[n]``, where `n = \left| \lambda \right|`, is `s_{\lambda'}` (where `\lambda'` is the conjugate partition of `\lambda`):: sage: F = CyclotomicField(12) sage: s = SymmetricFunctions(F).s() sage: e = SymmetricFunctions(F).e() sage: all( e([5]).itensor(s(p)) == s(p.conjugate()) for p in Partitions(5) ) True The Kronecker product is commutative:: sage: e = SymmetricFunctions(FiniteField(19)).e() sage: m = SymmetricFunctions(FiniteField(19)).m() sage: all( all( e(p).itensor(m(q)) == m(q).itensor(e(p)) for q in Partitions(4) ) ....: for p in Partitions(4) ) True sage: F = FractionField(QQ['q','t']) sage: mq = SymmetricFunctions(F).macdonald().Q() sage: mh = SymmetricFunctions(F).macdonald().H() sage: all( all( mq(p).itensor(mh(r)) == mh(r).itensor(mq(p)) for r in Partitions(4) ) ....: for p in Partitions(3) ) # long time True Let us check (on examples) Proposition 5.2 of Gelfand, Krob, Lascoux, Leclerc, Retakh, Thibon, "Noncommutative symmetric functions", :arXiv:`hep-th/9407124`, for `r = 2`:: sage: e = SymmetricFunctions(FiniteField(29)).e() sage: s = SymmetricFunctions(FiniteField(29)).s() sage: m = SymmetricFunctions(FiniteField(29)).m() sage: def tensor_copr(u, v, w): # computes \mu ((u \otimes v) * \Delta(w)) with ....: # * meaning Kronecker product and \mu meaning the ....: # usual multiplication. ....: result = w.parent().zero() ....: for partition_pair, coeff in w.coproduct().monomial_coefficients().iteritems(): ....: result += coeff * w.parent()(u).itensor(partition_pair[0]) * w.parent()(v).itensor(partition_pair[1]) ....: return result sage: all( all( all( tensor_copr(e[u], s[v], m[w]) == (e[u] * s[v]).itensor(m[w]) ....: for w in Partitions(5) ) ....: for v in Partitions(2) ) ....: for u in Partitions(3) ) # long time True Some examples from Briand, Orellana, Rosas, "The stability of the Kronecker products of Schur functions." :arXiv:`0907.4652`:: sage: s = SymmetricFunctions(ZZ).s() sage: s[2,2].itensor(s[2,2]) s[1, 1, 1, 1] + s[2, 2] + s[4] sage: s[3,2].itensor(s[3,2]) s[2, 1, 1, 1] + s[2, 2, 1] + s[3, 1, 1] + s[3, 2] + s[4, 1] + s[5] sage: s[4,2].itensor(s[4,2]) s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1] + s[4, 1, 1] + 2*s[4, 2] + s[5, 1] + s[6] An example from p. 220 of Thibon, "Hopf algebras of symmetric functions and tensor products of symmetric group representations", International Journal of Algebra and Computation, 0000:0000:0000:0000:0000:0000:0000:0000 sage: s = SymmetricFunctions(QQbar).s() sage: s[2,1].itensor(s[2,1]) s[1, 1, 1] + s[2, 1] + s[3] TESTS:: sage: s = SymmetricFunctions(QQ).s() sage: a = s([8,8]) sage: a.itensor(a) s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16] sage: s[8].itensor(s[7]) 0 sage: s(0).itensor(s(0)) 0 sage: s(1).itensor(s(0)) 0 sage: s(0).itensor(s(1)) 0 sage: s(1).itensor(s(1)) s[] Same over the ring of integers:: sage: s = SymmetricFunctions(ZZ).s() sage: a = s([8,8]) sage: a.itensor(a) s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16] sage: s[8].itensor(s[7]) 0 sage: s(0).itensor(s(0)) 0 sage: s(1).itensor(s(0)) 0 sage: s(0).itensor(s(1)) 0 sage: s(1).itensor(s(1)) s[] Theorem 2.1 in Bessenrodt, van Willigenburg, :arXiv:`1105.3170v2`:: sage: s = SymmetricFunctions(ZZ).s() sage: all( all( max( r[0] for r in s(p).itensor(s(q)).monomial_coefficients().keys() ) ....: == sum( min(p[i], q.get_part(i)) for i in range(len(p)) ) ....: for p in Partitions(4) ) ....: for q in Partitions(4) ) True sage: all( all( max( len(r) for r in s(p).itensor(s(q)).monomial_coefficients().keys() ) ....: == sum( min(p[i], q.conjugate().get_part(i)) for i in range(len(p)) ) ....: for p in Partitions(4) ) ....: for q in Partitions(4) ) True Check that the basis and ground ring of ``self`` are preserved:: sage: F = CyclotomicField(12) sage: s = SymmetricFunctions(F).s() sage: e = SymmetricFunctions(F).e() sage: e[3].itensor(s[3]) e[3] sage: s[3].itensor(e[3]) s[1, 1, 1] sage: parent(e[3].itensor(s[3])) Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the elementary basis sage: parent(s[3].itensor(e[3])) Symmetric Functions over Cyclotomic Field of order 12 and degree 4 in the Schur basis .. NOTE:: The currently existing implementation of this function is technically unsatisfactory. It distinguishes the case when the base ring is a `\QQ`-algebra (in which case the Kronecker product can be easily computed using the power sum basis) from the case where it isn't. In the latter, it does a computation using universal coefficients, again distinguishing the case when it is able to compute the "corresponding" basis of the symmetric function algebra over `\QQ` (using the ``corresponding_basis_over`` hack) from the case when it isn't (in which case it transforms everything into the Schur basis, which is slow).<|endoftext|>