diff --git a/experimental/FTheoryTools/src/LiteratureModels/constructors.jl b/experimental/FTheoryTools/src/LiteratureModels/constructors.jl index 64d3789cacb3..b8f29935c632 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/constructors.jl +++ b/experimental/FTheoryTools/src/LiteratureModels/constructors.jl @@ -259,7 +259,7 @@ function _construct_literature_model_over_concrete_base(model_dict::Dict{String, # Find divisor classes of the internal model sections auxiliary_base_grading = matrix(ZZ, transpose(hcat([[eval_poly(weight, ZZ) for weight in vec] for vec in model_dict["model_data"]["auxiliary_base_grading"]]...))) - auxiliary_base_grading = vcat([[Int(k) for k in auxiliary_base_grading[i,:]] for i in 1:nrows(auxiliary_base_grading)]...) + auxiliary_base_grading = vcat([[Int(k) for k in auxiliary_base_grading[i:i,:]] for i in 1:nrows(auxiliary_base_grading)]...) internal_model_sections = Dict{String, ToricDivisor}() for k in 2+length(model_sections):ngens(auxiliary_base_ring) divisor = sum([auxiliary_base_grading[l,k] * model_sections_divisor_list[l] for l in 1:nrows(auxiliary_base_grading)]) @@ -399,7 +399,7 @@ function _construct_literature_model_over_arbitrary_base(model_dict::Dict{String @req haskey(model_dict["model_data"], "auxiliary_base_grading") "Database does not specify auxiliary_base_grading, but is vital for model constrution, so cannot proceed" auxiliary_base_grading = matrix(ZZ, transpose(hcat([[eval_poly(weight, ZZ) for weight in vec] for vec in model_dict["model_data"]["auxiliary_base_grading"]]...))) - auxiliary_base_grading = vcat([[Int(k) for k in auxiliary_base_grading[i,:]] for i in 1:nrows(auxiliary_base_grading)]...) + auxiliary_base_grading = vcat([[Int(k) for k in auxiliary_base_grading[i:i,:]] for i in 1:nrows(auxiliary_base_grading)]...) base_dim = get(model_dict["model_data"], "base_dim", 3) diff --git a/experimental/FTheoryTools/src/auxiliary.jl b/experimental/FTheoryTools/src/auxiliary.jl index 221421060185..1df22edcefbb 100644 --- a/experimental/FTheoryTools/src/auxiliary.jl +++ b/experimental/FTheoryTools/src/auxiliary.jl @@ -29,7 +29,7 @@ function _ambient_space(base::NormalToricVariety, fiber_amb_space::NormalToricVa a_rays[1:nrows(b_rays), 1:ncols(b_rays)] = b_rays a_rays[1:nrows(b_rays), 1+ncols(b_rays):ncols(a_rays)] = transpose(u_matrix) a_rays[1+nrows(b_rays):nrows(a_rays), 1+ncols(b_rays):ncols(a_rays)] = f_rays - a_cones = [hcat([b for b in b_cones[i,:]], [c for c in f_cones[j,:]]) for i in 1:nrows(b_cones), j in 1:nrows(f_cones)] + a_cones = [hcat([b for b in b_cones[i:i,:]], [c for c in f_cones[j:j,:]]) for i in 1:nrows(b_cones), j in 1:nrows(f_cones)] a_space = normal_toric_variety(IncidenceMatrix(vcat(a_cones...)), a_rays; non_redundant = true) set_coordinate_names(a_space, vcat(b_var_names, f_var_names)) diff --git a/experimental/GITFans/src/GITFans.jl b/experimental/GITFans/src/GITFans.jl index 2f49c61fdeff..2b6fd7e07a5e 100644 --- a/experimental/GITFans/src/GITFans.jl +++ b/experimental/GITFans/src/GITFans.jl @@ -465,7 +465,7 @@ function fan_traversal(orbit_list::Vector{Vector{Cone{T}}}, q_cone::Cone{T}, per neighbor_hashes = [] for i in 1:length(facet_points) !any(f->facet_points[i] in f, facets(Cone, q_cone)) || continue - push!(neighbor_hashes, get_neighbor_hash(orbit_list, facet_points[i], Vector{T}([ic_facets[i, :]...]))) + push!(neighbor_hashes, get_neighbor_hash(orbit_list, facet_points[i], Vector{T}([ic_facets[i:i, :]...]))) end neighbor_hashes = [find_smallest_orbit_element(i, generators_new_perm, bitlist_oper_tuple, ==, less_or_equal_array_bitlist) for i in neighbor_hashes] diff --git a/experimental/GaloisGrp/src/Solve.jl b/experimental/GaloisGrp/src/Solve.jl index 20a78b042be5..748f53d9231c 100644 --- a/experimental/GaloisGrp/src/Solve.jl +++ b/experimental/GaloisGrp/src/Solve.jl @@ -687,7 +687,7 @@ function conj_from_basis(C::GaloisCtx, S::SubField, a, pr) for i=0:degree(S.fld)-1 d = conjugates(C, S.coeff_field, coeff(a, i), pr) for j=1:length(d) - tmp[1, (j-1)*degree(S.fld)+1:j*degree(S.fld)] = d[j]*nb[i+1, (j-1)*degree(S.fld)+1:j*degree(S.fld)] + tmp[1, (j-1)*degree(S.fld)+1:j*degree(S.fld)] = d[j]*nb[i+1:i+1, (j-1)*degree(S.fld)+1:j*degree(S.fld)] end res += tmp end diff --git a/experimental/LieAlgebras/src/CartanMatrix.jl b/experimental/LieAlgebras/src/CartanMatrix.jl index e887ff3c6beb..0858454b9611 100644 --- a/experimental/LieAlgebras/src/CartanMatrix.jl +++ b/experimental/LieAlgebras/src/CartanMatrix.jl @@ -244,7 +244,7 @@ function cartan_bilinear_form(gcm::ZZMatrix; check::Bool=true) sym = cartan_symmetrizer(gcm; check) bil = deepcopy(gcm) for i in 1:length(sym) - mul!(view(bil, i, :), sym[i]) + mul!(view(bil, i:i, :), sym[i]) end return bil end diff --git a/experimental/LieAlgebras/src/RootSystem.jl b/experimental/LieAlgebras/src/RootSystem.jl index ab7256a7d321..21277ffde10b 100644 --- a/experimental/LieAlgebras/src/RootSystem.jl +++ b/experimental/LieAlgebras/src/RootSystem.jl @@ -812,7 +812,7 @@ end Reflects the `w` at the `s`-th simple root in place and returns `w`. """ function reflect!(w::WeightLatticeElem, s::Int) - addmul!(w.vec, view(cartan_matrix(root_system(w)), :, s), -w.vec[s]) + addmul!(w.vec, view(cartan_matrix(root_system(w)), :, s:s), -w.vec[s]) return w end diff --git a/experimental/QuadFormAndIsom/test/runtests.jl b/experimental/QuadFormAndIsom/test/runtests.jl index c95172e9d597..940b57243b1c 100644 --- a/experimental/QuadFormAndIsom/test/runtests.jl +++ b/experimental/QuadFormAndIsom/test/runtests.jl @@ -364,7 +364,7 @@ end B = matrix(FlintQQ, 5, 5 ,[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]); G = matrix(FlintQQ, 5, 5 ,[3, 1, 0, 0, 0, 1, 3, 1, 1, -1, 0, 1, 3, 0, 0, 0, 1, 0, 3, 0, 0, -1, 0, 0, 3]); L = integer_lattice(B, gram = G); - k = lattice_in_same_ambient_space(L, B[2, :]) + k = lattice_in_same_ambient_space(L, B[2:2, :]) N = orthogonal_submodule(L, k) ok, reps = primitive_extensions(k, N; glue_order=3) @test ok diff --git a/experimental/Schemes/ToricIdealSheaves/constructors.jl b/experimental/Schemes/ToricIdealSheaves/constructors.jl index c7cb50194f28..799a63843f67 100644 --- a/experimental/Schemes/ToricIdealSheaves/constructors.jl +++ b/experimental/Schemes/ToricIdealSheaves/constructors.jl @@ -85,7 +85,7 @@ function IdealSheaf(X::NormalToricVariety, I::MPolyIdeal) for m in hilbert_basis(weight_cone(U)) img = one(help_ring) for j in 1:length(indices) - u_rho = matrix(ZZ,rays(X))[indices[j],:] + u_rho = matrix(ZZ,rays(X))[indices[j]:(indices[j]),:] expo = (u_rho*m)[1] img = img * x_rho[j]^expo end diff --git a/experimental/SymmetricIntersections/src/homogeneous_polynomial_actions.jl b/experimental/SymmetricIntersections/src/homogeneous_polynomial_actions.jl index c8867abb1f12..6ec8e79f693c 100644 --- a/experimental/SymmetricIntersections/src/homogeneous_polynomial_actions.jl +++ b/experimental/SymmetricIntersections/src/homogeneous_polynomial_actions.jl @@ -20,7 +20,7 @@ function is_semi_invariant_polynomial(rep::LinRep, f::S) where S <: MPolyDecRing R1, R1toR = homogeneous_component(R, 1) repd = dual_representation(rep) for m in matrix_representation(repd) - poly_m = elem_type(R)[R1toR(R1(reverse_cols!(m[i,:]))) for i in 1:nrows(m)] + poly_m = elem_type(R)[R1toR(R1(reverse_cols!(m[i:i,:]))) for i in 1:nrows(m)] fd = evaluate(f, poly_m) ok, k = divides(fd, f) if !ok || !is_constant(k) @@ -48,7 +48,7 @@ function linear_representation(rep::LinRep, f::S) where S <: MPolyDecRingElem repd = dual_representation(rep) coll = eltype(matrix_representation(rep))[] for m in matrix_representation(rep) - poly_m = elem_type(R)[R1toR(R1(reverse_cols!(m[i,:]))) for i in 1:nrows(m)] + poly_m = elem_type(R)[R1toR(R1(reverse_cols!(m[i:i,:]))) for i in 1:nrows(m)] fd = evaluate(f, poly_m) ok, k = divides(fd, f) @req ok && is_constant(k) "Polynomial is not semi-invariant" @@ -74,7 +74,7 @@ function is_invariant_ideal(rep::LinRep, I::S) where S <: MPolyIdeal{<: MPolyDec R1, R1toR = homogeneous_component(R, 1) repd = dual_representation(rep) for f in gene for m in matrix_representation(repd) - poly_m = elem_type(R)[R1toR(R1(reverse_cols!(m[i,:]))) for i in 1:nrows(m)] + poly_m = elem_type(R)[R1toR(R1(reverse_cols!(m[i:i,:]))) for i in 1:nrows(m)] fd = evaluate(f, poly_m) fd in I || return false end @@ -147,7 +147,7 @@ function parametrization_data(symci::SymInter) for (B, n) in pd B2 = Vector{MPolyDecRingElem}[] for b in B - vv = elem_type(S)[j(R(reverse_cols!(b[i,:]))) for i in 1:nrows(b)] + vv = elem_type(S)[j(R(reverse_cols!(b[i:i,:]))) for i in 1:nrows(b)] push!(B2, vv) end push!(pd2, (B2, n)) @@ -169,7 +169,7 @@ function standard_element(symci::SymInter) std_el2 = elem_type(S)[] for B in std_el for b in B - vv = elem_type(S)[j(R(reverse_cols!(b[i,:]))) for i in 1:nrows(b)] + vv = elem_type(S)[j(R(reverse_cols!(b[i:i,:]))) for i in 1:nrows(b)] append!(std_el2, vv) end end diff --git a/experimental/SymmetricIntersections/src/representations.jl b/experimental/SymmetricIntersections/src/representations.jl index dd278fac14f4..e5ca6e2bedba 100644 --- a/experimental/SymmetricIntersections/src/representations.jl +++ b/experimental/SymmetricIntersections/src/representations.jl @@ -894,7 +894,7 @@ function _action_symmetric_power(mr::Vector{AbstractAlgebra.Generic.MatSpaceElem bsp = reverse!(RdtoR.(gens(Rd))) coll = eltype(mr)[] for m in mr - poly_m = elem_type(R)[R1toR(R1(reverse_cols!(m[i,:]))) for i in 1:nrows(m)] + poly_m = elem_type(R)[R1toR(R1(reverse_cols!(m[i:i,:]))) for i in 1:nrows(m)] @assert length(poly_m) == n m2 = zero_matrix(F, length(bsp), length(bsp)) for i = 1:length(bsp) @@ -1278,8 +1278,8 @@ function complement_submodule(rep::LinRep{S, T, U}, M::W) where {S, T, U, W <: M _K = zero_matrix(F, d*length(B1), d*length(B2)) for j in 1:length(B2) B2j = B2[j] - B2jM = (B2j*M)[1,:] - B1u = reduce(vcat, [BB[1,:] for BB in B1]) + B2jM = (B2j*M)[1:1,:] + B1u = reduce(vcat, [BB[1:1,:] for BB in B1]) _Kj = solve_left(B1u, B2jM) for i in 1:d, k in 1:length(B1) _K[(k-1)*d + i, i + (j-1)*d] = _Kj[1, k] diff --git a/src/AlgebraicGeometry/Surfaces/K3Auto.jl b/src/AlgebraicGeometry/Surfaces/K3Auto.jl index d642cd4fb374..12d50f3a7af1 100644 --- a/src/AlgebraicGeometry/Surfaces/K3Auto.jl +++ b/src/AlgebraicGeometry/Surfaces/K3Auto.jl @@ -123,7 +123,7 @@ function BorcherdsCtx(L::ZZLat, S::ZZLat, weyl::ZZMatrix; compute_OR::Bool=true) I = identity_matrix(QQ,degree(L)) # prS: L --> S^\vee given with respect to the standard basis of L and the basis of S prS = ibSR*I[:,1:rank(S)]#*basis_matrix(S) - @assert prS[rank(S)+1,:]==0 + @assert prS[[rank(S)+1],:]==0 if compute_OR @@ -486,7 +486,7 @@ function _possible(D::K3Chamber, per, I, J) end for i in 1:I - if (vectorsj*T[:,i])[1,1] != gramB[J,per[i]] + if (vectorsj*T[:,i:i])[1,1] != gramB[J,per[i]] good_scalar = false break end @@ -617,7 +617,7 @@ function separating_hyperplanes(gram::QQMatrix, v::QQMatrix, h::QQMatrix, d) ch = QQ((h*gram*transpose(h))[1,1]) cv = QQ((h*gram*transpose(v))[1,1]) b = basis_matrix(L) - prW = reduce(vcat,[b[i,:] - (b[i,:]*gram*transpose(h))*ch^-1*h for i in 1:n]) + prW = reduce(vcat,[b[i:i,:] - (b[i:i,:]*gram*transpose(h))*ch^-1*h for i in 1:n]) W = lattice(ambient_space(L), prW, isbasis=false) bW = basis_matrix(W) # set up the quadratic triple for SW @@ -747,7 +747,7 @@ function alg319(D::K3Chamber, E::K3Chamber) k = nrows(img) gi = gram*transpose(img) for r in raysE - if (r*gram*transpose(r))[1,1] != gram_basis[k+1,k+1] || (k>0 && r*gi != gram_basis[k+1,1:k]) + if (r*gram*transpose(r))[1,1] != gram_basis[k+1,k+1] || (k>0 && r*gi != gram_basis[k+1:k+1,1:k]) continue end # now r has the correct inner products with what we need @@ -816,7 +816,7 @@ function alg319(gram::MatrixElem, basis::ZZMatrix, gram_basis::QQMatrix, raysD:: k = nrows(img) gi = gram*transpose(img) for r in raysE - if (r*gram*transpose(r))[1,1] != gram_basis[k+1,k+1] || (k>0 && r*gi != gram_basis[k+1,1:k]) + if (r*gram*transpose(r))[1,1] != gram_basis[k+1,k+1] || (k>0 && r*gi != gram_basis[k+1:k+1,1:k]) continue end # now r has the correct inner products with what we need @@ -1732,8 +1732,8 @@ function weyl_vector(L::ZZLat, U0::ZZLat) v = (v + 2*x)*basis_matrix(R) @hassert :K3Auto 1 mod(inner_product(V,v,v)[1,1], 8)==0 u = basis_matrix(U) - f1 = u[1,:] - e1 = u[2,:] + u[1,:] + f1 = u[1:1,:] + e1 = u[2:2,:] + u[1:1,:] f2 = -inner_product(V, v, v)*1//4*f1 + 2*e1 + v @hassert :K3Auto 1 inner_product(V, f2, f2)==0 @@ -1759,8 +1759,8 @@ function weyl_vector(L::ZZLat, U0::ZZLat) @vprint :K3Auto 1 "found a lattice of minimum $(m) \n" if m==4 # R is isomorphic to the Leech lattice - fu = basis_matrix(U)[1,:] - zu = basis_matrix(U)[2,:] + fu = basis_matrix(U)[1:1,:] + zu = basis_matrix(U)[2:2,:] u0 = 3*fu+zu return fu,u0 end @@ -1770,8 +1770,8 @@ function weyl_vector(L::ZZLat, U0::ZZLat) # with the attached hyperbolic planes this can be engineered to give an isometry @hassert :K3Auto 1 mod(inner_product(V,v,v)[1,1],2*h^2)==0 u = basis_matrix(U) - f1 = u[1,:] - e1 = u[2,:] + u[1,:] + f1 = u[1:1,:] + e1 = u[2:2,:] + u[1:1,:] f2 = -inner_product(V, v, v)*1//(2*h)*f1 + h*e1 + v @hassert :K3Auto 1 inner_product(V, f2, f2)==0 @@ -1821,7 +1821,7 @@ function borcherds_method_preprocessing(S::ZZLat, n::Integer; ample=nothing) u = u2*u1 @assert g2 == u*G*transpose(u) B = u*basis_matrix(L) - B = vcat(B[1,:],B[end,:]-B[1,:]) + B = vcat(B[1:1,:],B[end:end,:]-B[1:1,:]) if inner_product(V,B,B) != QQ[0 1; 1 -2] # find an isotropic vector if gram_matrix(S)[1,1]==0 @@ -1882,7 +1882,7 @@ function ample_class(S::ZZLat) u = basis_matrix(S)[1:2,:] if inner_product(V,u,u) == QQ[0 1; 1 -2] h = zero_matrix(QQ,1,rank(S)) - v = 3*u[1,:] + u[2,:] + v = 3*u[1:1,:] + u[2:2,:] fudge = 1 nt = 0 while true @@ -1913,7 +1913,7 @@ function ample_class(S::ZZLat) G = gram_matrix(S) D, B = Hecke._gram_schmidt(G,identity,true) i = findfirst(x->x, [d>0 for d in diagonal(D)]) - v = B[i,:] + v = B[i:i,:] v = denominator(v)*v vsq = (v*gram_matrix(S)*transpose(v))[1,1] @assert vsq > 0 @@ -2020,7 +2020,7 @@ function find_section(L::ZZLat, f::QQMatrix) g = [abs(i) for i in vec(collect(inner_product(ambient_space(L),f,basis_matrix(L))))] if 1 in g i = findfirst(x->x==1,g) - s = basis_matrix(L)[i,:] + s = basis_matrix(L)[i:i,:] s = sign(inner_product(ambient_space(L),f,s)[1,1])*s else # search a smallish section using a cvp diff --git a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl index 2285fe161fde..79fdb9e837aa 100644 --- a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl +++ b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl @@ -228,13 +228,13 @@ function normal_toric_variety_from_star_triangulation(P::Polyhedron) # Find position of origin in the lattices points of the polyhedron P pts = matrix(ZZ, lattice_points(P)) zero = [0 for i in 1:ambient_dim(P)] - indices = findall(k -> pts[k,:] == matrix(ZZ, [zero]), 1:nrows(pts)) + indices = findall(k -> pts[k:k,:] == matrix(ZZ, [zero]), 1:nrows(pts)) @req length(indices) == 1 "Polyhedron must contain origin (exactly once)" # Change order of lattice points s.t. zero is the first point - tmp = pts[1,:] - pts[1,:] = pts[indices[1],:] - pts[indices[1],:] = tmp + tmp = pts[1:1,:] + pts[1:1,:] = pts[indices[1]:indices[1],:] + pts[indices[1]:indices[1],:] = tmp # Find one triangulation and turn it into the maximal cones of the toric variety in question. Note that: # (a) needs to be converted to incidence matrix @@ -242,7 +242,7 @@ function normal_toric_variety_from_star_triangulation(P::Polyhedron) max_cones = IncidenceMatrix([[c[i]-1 for i in 2:length(c)] for c in _find_full_star_triangulation(pts)]) # Rays are all but the zero vector at the first position of pts - integral_rays = reduce(vcat, [pts[k,:] for k in 2:nrows(pts)]) + integral_rays = reduce(vcat, [pts[k:k,:] for k in 2:nrows(pts)]) # construct the variety return normal_toric_variety(max_cones, integral_rays; non_redundant = true) @@ -280,7 +280,7 @@ function normal_toric_varieties_from_star_triangulations(P::Polyhedron) # find position of origin in the lattices points of the polyhedron P pts = matrix(ZZ, lattice_points(P)) zero = [0 for i in 1:ambient_dim(P)] - indices = findall(k -> pts[k,:] == matrix(ZZ, [zero]), 1:nrows(pts)) + indices = findall(k -> pts[k:k,:] == matrix(ZZ, [zero]), 1:nrows(pts)) @req length(indices) == 1 "Polyhedron must contain origin (exactly once)" # change order of lattice points s.t. zero is the first point @@ -408,7 +408,7 @@ function normal_toric_varieties_from_glsm(charges::ZZMatrix) pts = vcat(matrix(QQ, transpose(zero)), matrix(QQ, pts)) # construct varieties - integral_rays = reduce(vcat, [pts[k,:] for k in 2:nrows(pts)]) + integral_rays = reduce(vcat, [pts[k:k,:] for k in 2:nrows(pts)]) max_cones = [IncidenceMatrix([[c[i]-1 for i in 2:length(c)] for c in t]) for t in star_triangulations(pts; full = true)] varieties = [normal_toric_variety(cones, integral_rays; non_redundant = true) for cones in max_cones] diff --git a/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/attributes.jl b/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/attributes.jl index 91dde0fb7b3a..b478a69c21d5 100644 --- a/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/attributes.jl @@ -77,8 +77,8 @@ Map for i in 1:nrows(images) v = [images[i,k] for k in 1:ncols(images)] j = findfirst(x -> x == true, [(v in maximal_cones(cod)[j]) for j in 1:nmaxcones(cod)]) - m = reduce(vcat, [Int(ray_indices(maximal_cones(cod))[j, k]) * cod_rays[k, :] for k in 1:nrays(cod)]) - mapping_matrix = hcat(mapping_matrix, solve(transpose(m), transpose(images[i, :]))) + m = reduce(vcat, [Int(ray_indices(maximal_cones(cod))[j, k]) * cod_rays[k:k, :] for k in 1:nrays(cod)]) + mapping_matrix = hcat(mapping_matrix, solve(transpose(m), transpose(images[i:i, :]))) end return hom(torusinvariant_weil_divisor_group(d), torusinvariant_weil_divisor_group(cod), transpose(mapping_matrix)) end diff --git a/src/AlgebraicGeometry/ToricVarieties/ToricSchemes/attributes.jl b/src/AlgebraicGeometry/ToricVarieties/ToricSchemes/attributes.jl index c80073bd1772..b61ed5347ec9 100644 --- a/src/AlgebraicGeometry/ToricVarieties/ToricSchemes/attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/ToricSchemes/attributes.jl @@ -183,12 +183,12 @@ end # Write the elements in `degs2` as linear combinations of `degs1`, allowing only non-negative # coefficients for the vectors vᵢ of `degs1` with index i ∈ `non_local_indices`. -function _convert_degree_system(degs1::ZZMatrix, degs2::ZZMatrix, non_local_indices_1::Vector{Int64}) +function _convert_degree_system(degs1::ZZMatrix, degs2::ZZMatrix, non_local_indices_1::Vector{Int}) result = Vector{ZZMatrix}() for i in 1:nrows(degs2) C = identity_matrix(ZZ, nrows(degs1))[non_local_indices_1,:] - S = solve_mixed(transpose(degs1), transpose(degs2[i,:]), C; permit_unbounded=true) - push!(result, S[1, :]) + S = solve_mixed(transpose(degs1), transpose(degs2[i:i,:]), C; permit_unbounded=true) + push!(result, S[1:1, :]) end return result end diff --git a/src/Groups/matrices/FiniteFormOrthogonalGroup.jl b/src/Groups/matrices/FiniteFormOrthogonalGroup.jl index ee413587e5b1..6af104943d62 100644 --- a/src/Groups/matrices/FiniteFormOrthogonalGroup.jl +++ b/src/Groups/matrices/FiniteFormOrthogonalGroup.jl @@ -368,14 +368,14 @@ function _lift(q::T, f::T, a) where T <: Union{ZZModMatrix, zzModMatrix} if mod(lift(q[end-1,end-1] + q[end,end]), 4) == 2 g[end, end-1] = a g[1:end-2,end-1] = diagonal(divexact(G - f*G*transpose(f),2)) - g[end,1:end-2] = transpose(fGinv * g[1:end-2,end-1]) + g[end:end,1:end-2] = transpose(fGinv * g[1:end-2,end-1:end-1]) else if a == 0 a = zeros(R, ncols(q)-2) end g[1:end-2,end-1] = a - g[end,1:end-2] = transpose(fGinv * g[1:end-2,end-1]) - t = (g[end,1:end-2]*G*transpose(g[end,1:end-2]))[1,1] + g[[end],1:end-2] = transpose(fGinv * g[1:end-2,end-1:end-1]) + t = (g[end:end,1:end-2]*G*transpose(g[end:end,1:end-2]))[1,1] g[end,end-1] = divexact(t-mod(lift(t), 2), 2) end err = g*qb*transpose(g)-qb @@ -642,9 +642,9 @@ function _ker_gens(G::Union{ZZModMatrix, zzModMatrix}, i1, i2, parity) end if parity[1]==1 && parity[3]==1 # compensate - g[e+1, i1] = divexact((g[e+1,i1+1:i2]*G[i1+1:i2,i1+1:i2]*transpose(g[e+1,i1+1:i2]))[1,1],4) + g[e+1, i1] = divexact((g[e+1:e+1,i1+1:i2]*G[i1+1:i2,i1+1:i2]*transpose(g[e+1:e+1,i1+1:i2]))[1,1],4) # the second row depends on the third - g[i1+1:i2,i1] = - divexact((G[i1+1:i2,i1+1:i2]* transpose(g[i2+1:end,i1+1:i2]) * inv(G[i2+1:end,i2+1:end]))[:,end], 2) + g[i1+1:i2,i1:i1] = - divexact((G[i1+1:i2,i1+1:i2]* transpose(g[i2+1:end,i1+1:i2]) * inv(G[i2+1:end,i2+1:end]))[:,end:end], 2) end if g[i,j] == 1 # no need to append the identity push!(gens, g) diff --git a/src/Groups/matrices/iso_nf_fq.jl b/src/Groups/matrices/iso_nf_fq.jl index f83028f34a88..71b0020b0cbc 100644 --- a/src/Groups/matrices/iso_nf_fq.jl +++ b/src/Groups/matrices/iso_nf_fq.jl @@ -178,7 +178,7 @@ function test_modulus(matrices::Vector{T}, p::Int) where T <: MatrixElem{nf_elem # I don't want to invert everything in char 0, so I just check whether the # matrices are still invertible mod p. for i = 1:length(matrices) - matrices_Fq[i] = matrix(Fq, [ OtoFq(O(numerator(a)))//OtoFq(O(denominator(a))) for a in matrices[i] ]) + matrices_Fq[i] = map_entries(a -> OtoFq(O(numerator(a)))//OtoFq(O(denominator(a))), matrices[i]) if rank(matrices_Fq[i]) != nrows(matrices_Fq[i]) return false, Fq, matrices_Fq, Hecke.NfOrdToFqMor() end diff --git a/src/Groups/spinor_norms.jl b/src/Groups/spinor_norms.jl index 50b46ebe0223..687fe04feb47 100644 --- a/src/Groups/spinor_norms.jl +++ b/src/Groups/spinor_norms.jl @@ -124,7 +124,7 @@ function reflection(gram::MatElem, v::MatElem) c = base_ring(gram)(2) * ((v * gram * transpose(v)))[1,1]^(-1) ref = zero_matrix(base_ring(gram), n, n) for k in 1:n - ref[k,:] = E[k,:] - c*(E[k,:] * gram * transpose(v))*v + ref[k:k,:] = E[k:k,:] - c*(E[k:k,:] * gram * transpose(v))*v end return ref end @@ -206,7 +206,7 @@ function det_spin(G::QQMatrix, T::QQMatrix, p, nu) k = 1 while k <= l - g = T[k,:] + g = T[k:k,:] # error estimates lambd = valuation(g, p) rho = min(delta + nu + gamma, 2*nu + gamma) @@ -216,20 +216,20 @@ function det_spin(G::QQMatrix, T::QQMatrix, p, nu) # precision too low return ZZ(0), QQ(0) end - bm = g - E[k,:] + bm = g - E[k:k,:] qm = bm * G * transpose(bm) if valuation(qm, p) <= gammaL[k] + 2*delta tau1 = reflection(G, bm) push!(reflection_vectors, bm) tau2 = E else - bp = g + E[k,:] + bp = g + E[k:k,:] qp = bp * G * transpose(bp) @assert valuation(qp, p) <= gammaL[k] + 2*delta tau1 = reflection(G, bp) - tau2 = reflection(G, E[k,:]) + tau2 = reflection(G, E[k:k,:]) push!(reflection_vectors,bp) - push!(reflection_vectors,E[k,:]) + push!(reflection_vectors,E[k:k,:]) end lambdaT = valuation(T, p) alpha = valuation(tau1, p) diff --git a/src/Modules/ModuleTypes.jl b/src/Modules/ModuleTypes.jl index 02decdce8796..43bcc30af1b6 100644 --- a/src/Modules/ModuleTypes.jl +++ b/src/Modules/ModuleTypes.jl @@ -610,7 +610,7 @@ function FreeModuleHom( ) where {T<:RingElem,S<:AbstractFreeMod} @assert nrows(mat) == ngens(F) @assert ncols(mat) == ngens(G) - hom = FreeModuleHom(F, G, [FreeModElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)]) + hom = FreeModuleHom(F, G, [FreeModElem(sparse_row(mat[i:i,:]), G) for i=1:ngens(F)]) hom.matrix = mat return hom end @@ -620,7 +620,7 @@ function FreeModuleHom( ) where {T<:RingElem, S<:ModuleFP} @assert nrows(mat) == ngens(F) @assert ncols(mat) == ngens(G) - hom = FreeModuleHom(F, G, [SubquoModuleElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)]) + hom = FreeModuleHom(F, G, [SubquoModuleElem(sparse_row(mat[i:i,:]), G) for i=1:ngens(F)]) hom.matrix = mat return hom end @@ -631,7 +631,7 @@ function FreeModuleHom( @assert nrows(mat) == ngens(F) @assert ncols(mat) == ngens(G) @assert base_ring(mat) === base_ring(G) - hom = FreeModuleHom(F, G, [FreeModElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)], h) + hom = FreeModuleHom(F, G, [FreeModElem(sparse_row(mat[i:i,:]), G) for i=1:ngens(F)], h) hom.matrix = mat return hom end @@ -642,7 +642,7 @@ function FreeModuleHom( @assert nrows(mat) == ngens(F) @assert ncols(mat) == ngens(G) @assert base_ring(mat) === base_ring(G) - hom = FreeModuleHom(F, G, [SubquoModuleElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)], h) + hom = FreeModuleHom(F, G, [SubquoModuleElem(sparse_row(mat[i:i,:]), G) for i=1:ngens(F)], h) hom.matrix = mat return hom end diff --git a/src/Modules/Posur.jl b/src/Modules/Posur.jl index cc2e94a84d29..a8d1099b5762 100644 --- a/src/Modules/Posur.jl +++ b/src/Modules/Posur.jl @@ -212,7 +212,7 @@ function has_solution( (success, u, a) = has_nonempty_intersection(U, I, check=check) success || return (false, zero_matrix(R, 1, ngens(I)), zero(R)) l = a*L - return (success, l[1, 2:end], l[1,1]) + return (success, l[1:1, 2:end], l[1,1]) end ######################################################################## @@ -494,8 +494,8 @@ function coordinates(u::FreeModElem{T}, M::SubquoModule{T}) where {T<:AbsLocaliz # # with x = [y z]. Now we would like to cache v' as a new generator for the # `pre_saturated_module(M)` and w' as a new relation of it. - y = x[1, 1:r] - z = x[1, r+1:r+s] + y = x[1:1, 1:r] + z = x[1:1, r+1:r+s] v = y*A w = z*B (v_clear, d_v) = clear_denominators(v) @@ -524,7 +524,7 @@ function coordinates(u::FreeModElem{T}, M::SubquoModule{T}) where {T<:AbsLocaliz ) set_attribute!(M, :pre_saturated_module, Mbext) # finally, return the computed coordinates - result = x[1, 1:r] + result = x[1:1, 1:r] return sparse_row(result) end @@ -582,8 +582,8 @@ function represents_element(u::FreeModElem{T}, M::SubquoModule{T}) where {T<:Abs # # with x = [y z]. Now we would like to cache v' as a new generator for the # `pre_saturated_module(M)` and w' as a new relation of it. - y = x[1, 1:r] - z = x[1, r+1:r+s] + y = x[1:1, 1:r] + z = x[1:1, r+1:r+s] v = y*A w = z*B (v_clear, d_v) = clear_denominators(v) diff --git a/src/Modules/UngradedModules/SubModuleOfFreeModule.jl b/src/Modules/UngradedModules/SubModuleOfFreeModule.jl index f911245db512..8a4e603433cb 100644 --- a/src/Modules/UngradedModules/SubModuleOfFreeModule.jl +++ b/src/Modules/UngradedModules/SubModuleOfFreeModule.jl @@ -47,7 +47,7 @@ module is `F`. In particular, `rank(F) == ncols(A)` must hold. """ function SubModuleOfFreeModule(F::FreeMod{L}, A::MatElem{L}) where {L} subModule = SubModuleOfFreeModule{L}(F) - O = [FreeModElem(sparse_row(A[i,:]), F) for i in 1:nrows(A)] + O = [FreeModElem(sparse_row(A[i:i,:]), F) for i in 1:nrows(A)] subModule.gens = ModuleGens(O, F) subModule.matrix = A return subModule diff --git a/src/Modules/UngradedModules/SubQuoHom.jl b/src/Modules/UngradedModules/SubQuoHom.jl index 0b2394f43eda..32c6cec52cc7 100644 --- a/src/Modules/UngradedModules/SubQuoHom.jl +++ b/src/Modules/UngradedModules/SubQuoHom.jl @@ -21,10 +21,10 @@ function SubQuoHom(D::SubquoModule, C::ModuleFP{T}, mat::MatElem{T}; check::Bool @assert nrows(mat) == ngens(D) @assert ncols(mat) == ngens(C) if C isa FreeMod - hom = SubQuoHom(D, C, [FreeModElem(sparse_row(mat[i,:]), C) for i=1:ngens(D)]) + hom = SubQuoHom(D, C, [FreeModElem(sparse_row(mat[i:i,:]), C) for i=1:ngens(D)]) return hom else - hom = SubQuoHom(D, C, [SubquoModuleElem(sparse_row(mat[i,:]), C) for i=1:ngens(D)]) + hom = SubQuoHom(D, C, [SubquoModuleElem(sparse_row(mat[i:i,:]), C) for i=1:ngens(D)]) return hom end end @@ -1265,7 +1265,7 @@ function simplify(M::SubquoModule) for i=1:size(M_generators)[1] if i in to_delete index = findfirst(x -> x==i, to_delete) - assign_row!(projection_matrix, R(-1)*R(inv(coeff(K_gen[corresponding_row[index],i], 1)))*delete_columns(K_gen[corresponding_row[index],:], to_delete), i) + assign_row!(projection_matrix, R(-1)*R(inv(coeff(K_gen[corresponding_row[index],i], 1)))*delete_columns(K_gen[corresponding_row[index]:(corresponding_row[index]),:], to_delete), i) else standard_unit_vector_index = i-length(filter(x -> x < i, to_delete)) standard_unit_vector = [j == standard_unit_vector_index ? R(1) : R(0) for j=1:size(projection_matrix)[2]] diff --git a/src/Modules/missing_functionality.jl b/src/Modules/missing_functionality.jl index 04087b22071b..9e96c88f4a18 100644 --- a/src/Modules/missing_functionality.jl +++ b/src/Modules/missing_functionality.jl @@ -42,7 +42,7 @@ function coordinates(f::MPolyQuoRingElem, I::MPolyQuoIdeal) J = modulus(Q) R = base_ring(Q) K = ideal(R, vcat(lift.(gens(I)), gens(J))) - return Q.(coordinates(lift(f), K)[1, 1:ngens(I)]) + return Q.(coordinates(lift(f), K)[1:1, 1:ngens(I)]) end function lift(f::MPolyRingElem, I::MPolyIdeal, o::MonomialOrdering) diff --git a/src/PolyhedralGeometry/PolyhedralFan/standard_constructions.jl b/src/PolyhedralGeometry/PolyhedralFan/standard_constructions.jl index 6105126bca72..f22a4eaa519a 100644 --- a/src/PolyhedralGeometry/PolyhedralFan/standard_constructions.jl +++ b/src/PolyhedralGeometry/PolyhedralFan/standard_constructions.jl @@ -106,7 +106,7 @@ function star_subdivision(Sigma::_FanLikeType, new_ray::AbstractVector{<:Integer old_rays = matrix(ZZ, rays(Sigma)) # In case the new ray is an old ray. - new_ray_index = findfirst(i->vec(old_rays[i,:])==new_ray, 1:nrows(old_rays)) + new_ray_index = findfirst(i->vec(old_rays[i:i,:])==new_ray, 1:nrows(old_rays)) new_rays = old_rays if isnothing(new_ray_index) new_rays = vcat(old_rays, matrix(ZZ, [new_ray])) diff --git a/src/Rings/mpolyquo-localizations.jl b/src/Rings/mpolyquo-localizations.jl index e6a9a6928be5..0b685a396177 100644 --- a/src/Rings/mpolyquo-localizations.jl +++ b/src/Rings/mpolyquo-localizations.jl @@ -1729,7 +1729,7 @@ function coordinates(a::RingElem, I::MPolyQuoLocalizedIdeal) parent(a) === L || return coordinates(L(a), I) a in I || error("the given element is not in the ideal") x = coordinates(lift(a), pre_image_ideal(I), check=false) - return map_entries(L, x[1, 1:ngens(I)]) + return map_entries(L, x[1:1, 1:ngens(I)]) end function saturated_ideal(I::MPolyQuoLocalizedIdeal) diff --git a/src/Rings/orderings.jl b/src/Rings/orderings.jl index 2a627f5e0208..c1cbbf169d9d 100644 --- a/src/Rings/orderings.jl +++ b/src/Rings/orderings.jl @@ -93,7 +93,7 @@ function _canonical_matrix(w) if is_zero_row(w, i) continue end - nw = w[i, :] + nw = w[i:i, :] c = content(nw) if !isone(c) nw = divexact(nw, c) @@ -101,7 +101,7 @@ function _canonical_matrix(w) for j in 1:nrows(ww) h = findfirst(x->ww[j, x] != 0, 1:ncols(w)) if !iszero(nw[1, h]) - nw = abs(ww[j, h])*nw - sign(ww[j, h])*nw[1, h]*ww[j, :] + nw = abs(ww[j, h])*nw - sign(ww[j, h])*nw[1, h]*ww[j:j, :] end end if !iszero(nw) @@ -1954,7 +1954,7 @@ end function _opposite_ordering(nvars::Int, o::MatrixOrdering) M = o.matrix - M = reduce(hcat, [M[:,i] for i in ncols(M):-1:1]) + M = reduce(hcat, [M[:,i:i] for i in ncols(M):-1:1]) return MatrixOrdering(reverse(nvars+1 .- o.vars), M, false) end diff --git a/test/Rings/orderings.jl b/test/Rings/orderings.jl index 10b25b0d7631..a0f7c397db45 100644 --- a/test/Rings/orderings.jl +++ b/test/Rings/orderings.jl @@ -212,7 +212,7 @@ function test_opposite_ordering(a) R = base_ring(a) b = opposite_ordering(R, a) M = matrix(a) - N = reduce(hcat, [M[:,i] for i in ncols(M):-1:1]) + N = reduce(hcat, [M[:,i:i] for i in ncols(M):-1:1]) @test b == matrix_ordering(gens(R), N) @test a == opposite_ordering(R, b) end