Example #1
0
def calcRestrictMatrix_py(D, HermWeight, B_cF, S):
	"""
	This is a Python implementation of the C++ `calcMatrix()` function from `algo.cpp`.
	This is just for testing. See `test_calcMatrix()`.
	It does also exactly the same as `calcRestrictMatrix_any()`.
	"""

	# We also have a Python implementation for calculating the indexset,
	# but we can test that separately (`test_herm_modform_indexset()`)
	# and use the fast version here.
	if calcRestrictMatrix_py_Pure:
		indexset = herm_modform_indexset_py(D=D, B_cF=B_cF)
	else:
		from algo import herm_modform_indexset
		indexset = herm_modform_indexset(D=D, B_cF=B_cF)
	indexset_map = dict([(T,i) for (i,T) in enumerate(indexset)])

	precDim = calcPrecisionDimension(B_cF=B_cF, S=S)
	matrixRowCount = precDim
	matrixColumnCount = len(indexset)

	M = matrix(ZZ, matrixRowCount, matrixColumnCount)
	for T in curlF_iter_py(D=D, B_cF=B_cF):
		reduced = ReducedGL(T=T, D=D)
		column = indexset_map[reduced.matrix]
		row = ZZ((T * S).trace())
		assert row >= 0
		if row >= matrixRowCount: continue
		a_T = reduced.value(-HermWeight)
		M[row,column] += a_T

	M.set_immutable()
	return M
Example #2
0
def test_herm_modform_indexset(D=-3, B_cF=7):
	"""
	This also tests `\curlF` iteration and `reduceGL()`.
	"""
	from helpers import herm_modform_indexset_py
	from algo import herm_modform_indexset
	indexset = herm_modform_indexset(D=D, B_cF=B_cF)
	indexset_py = herm_modform_indexset_py(D=D, B_cF=B_cF)
	assert indexset == indexset_py
Example #3
0
def check_eisenstein_series_D3_weight6(vs, B_cF):
	"""
	We know that there must be an Eisenstein series in weight 6 with D=-3.
	We check for that.

	INPUT:

	- `vs` - Hermitian modular form Fourier expansion supervectorspace

	- `B_cF` - the limit of the precision index set for the Hermitian Fourier indices

	OUTPUT:

	- Not defined. We just raise a ValueError exception if this check fails.
	"""

	from algo import herm_modform_indexset
	from helpers import M2T_Odual
	D = -3
	HermWeight = 6
	indexset = herm_modform_indexset(D=D, B_cF=B_cF)
	jacobi_coeffs_1 = {
		(0, (0, 0)): 1,
		(1, (0, 0)): -240,
		(1, (1, 1)): -45,
		(2, (0, 0)): -3690,
		(2, (1, 1)): -1872,
		(3, (0, 0)): -19680,
		(3, (1, 1)): -11565,
		(4, (0, 0)): -57840,
		(4, (1, 1)): -43920
	}

	from reduceGL import reduce_GL
	def reduce_matrix_jacobi1(key, value):
		# In standard base of \cO^#.
		a, (b1, b2) = key
		m, char = reduce_GL((a, b1, b2, 1), D)
		# Like reduce_character_evalutation::value() in reduceGL.hpp.
		h = 6 # because D == -3
		k = -HermWeight
		detchar = char[1] * k
		if detchar % h == 0: detvalue = 1
		elif detchar % h == h/2: detvalue = -1
		else: assert False, "detchar %i" % detchar
		m = M2T_Odual(m, D)
		return m, value * detvalue
	jacobi_coeffs_1_transformed = dict(
		[reduce_matrix_jacobi1(key,value) for (key,value) in jacobi_coeffs_1.items()])

	indexmap = {}
	for m in jacobi_coeffs_1_transformed.keys():
		indexmap[m] = indexset.index(m)
	reverse_indexlist = sorted([(value,key) for (key,value) in indexmap.items()])

	def reduced_vector(v):
		new_v = [None] * len(indexmap)
		for i,(j,m) in enumerate(reverse_indexlist):
			new_v[i] = v[j]
		return vector(QQ, new_v)
	reduced_vs_basis = map(reduced_vector, vs.basis())
	reduced_vs_basis_matrix = matrix(QQ, reduced_vs_basis)

	vector_jac = [None] * len(indexmap)
	for i,(j,m) in enumerate(reverse_indexlist):
		vector_jac[i] = jacobi_coeffs_1_transformed[m]
	vector_jac = vector(QQ, vector_jac)

	try:
		lincomb = reduced_vs_basis_matrix.solve_left(vector_jac)
	except ValueError as e:
		if "no solutions" in str(e):
			print "reduced_vs_basis_matrix =", reduced_vs_basis_matrix, ", rank =", reduced_vs_basis_matrix.rank()
			print "vector_jac =", vector_jac
			assert False
		raise
	return lincomb