Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

530

531

532

533

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

554

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

570

571

572

573

574

575

576

577

578

579

580

581

582

583

584

585

586

587

588

589

590

591

592

593

594

595

596

597

598

599

600

601

602

603

604

605

606

607

608

609

610

611

612

613

614

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633

634

635

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

""" 

Quiver Homspace 

""" 

 

#***************************************************************************** 

# Copyright (C) 2012 Jim Stark <jstarx@gmail.com> 

# 2013 Simon King <simon.king@uni-jena.de> 

# 

# Distributed under the terms of the GNU General Public License (GPL) 

# 

# This code is distributed in the hope that it will be useful, 

# but WITHOUT ANY WARRANTY; without even the implied warranty 

# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

# 

# See the GNU General Public License for more details; the full text 

# is available at: 

# 

# http://www.gnu.org/licenses/ 

#***************************************************************************** 

 

from sage.categories.homset import Homset 

from sage.quivers.morphism import QuiverRepHom 

from sage.misc.cachefunc import cached_method 

 

class QuiverHomSpace(Homset): 

r""" 

A homomorphism of quiver representations (of one and the same quiver) 

is given by specifying, for each vertex of the quiver, a homomorphism 

of the spaces assigned to this vertex such that these homomorphisms 

commute with the edge maps. This class handles the set of all 

such maps, `Hom_Q(M, N)`. 

 

INPUT: 

 

- ``domain`` -- the domain of the homomorphism space 

 

- ``codomain`` -- the codomain of the homomorphism space 

 

OUTPUT: 

 

- :class:`QuiverHomSpace`, the homomorphism space 

``Hom_Q(domain, codomain)`` 

 

.. NOTE:: 

 

The quivers of the domain and codomain must be equal or a 

``ValueError`` is raised. 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1)) 

sage: H.dimension() 

2 

sage: H.gens() 

[Homomorphism of representations of Multi-digraph on 2 vertices, 

Homomorphism of representations of Multi-digraph on 2 vertices] 

""" 

Element = QuiverRepHom 

 

########################################################################### 

# # 

# PRIVATE FUNCTIONS # 

# These functions are not meant to be seen by the end user. # 

# # 

########################################################################### 

 

def __init__(self, domain, codomain, category=None): 

""" 

Initialize ``self``. Type ``QuiverHomSpace?`` for more information. 

 

TESTS:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1)) 

sage: TestSuite(H).run() 

""" 

# The data in the class is stored in the following private variables: 

# 

# * _base 

# The base ring of the representations M and N. 

# * _codomain 

# The QuiverRep object of the codomain N. 

# * _domain 

# The QuiverRep object of the domain M. 

# * _quiver 

# The quiver of the representations M and N. 

# * _space 

# A free module with ambient space. 

# 

# The free module _space is the homomorphism space. The ambient space 

# is k^n where k is the base ring and n is the sum of the dimensions of 

# the spaces of homomorphisms between the free modules attached in M 

# and N to the vertices of the quiver. Each coordinate represents a 

# single entry in one of those matrices. 

 

# Get the quiver and base ring and check that they are the same for 

# both modules 

if domain._semigroup != codomain._semigroup: 

raise ValueError("representations are not over the same quiver") 

self._quiver = domain._quiver 

self._semigroup = domain._semigroup 

 

# Check that the bases are compatible, and then initialise the homset: 

if codomain.base_ring() != domain.base_ring(): 

raise ValueError("representations are not over the same base ring") 

Homset.__init__(self, domain, codomain, category=category, base = domain.base_ring()) 

 

# To compute the Hom Space we set up a 'generic' homomorphism where the 

# maps at each vertex are described by matrices whose entries are 

# variables. Then the commutativity of edge diagrams gives us a 

# system of equations whose solution space is the Hom Space we're 

# looking for. The variables will be numbered consecutively starting 

# at 0, ordered first by the vertex the matrix occurs at, then by row 

# then by column. We'll have to keep track of which variables 

# correspond to which matrices. 

 

# eqs will count the number of equations in our system of equations, 

# varstart will be a list whose ith entry is the number of the 

# variable located at (0, 0) in the matrix assigned to the 

# ith vertex. (So varstart[0] will be 0.) 

eqs = 0 

verts = domain._quiver.vertices() 

varstart = [0]*(len(verts) + 1) 

 

# First assign to varstart the dimension of the matrix assigned to the 

# previous vertex. 

for v in verts: 

varstart[verts.index(v) + 1] = domain._spaces[v].dimension()*codomain._spaces[v].dimension() 

for e in domain._semigroup._sorted_edges: 

eqs += domain._spaces[e[0]].dimension()*codomain._spaces[e[1]].dimension() 

 

# After this cascading sum varstart[v] will be the sum of the 

# dimensions of the matrices assigned to vertices ordered before v. 

# This is equal to the number of the first variable assigned to v. 

for i in range(2, len(varstart)): 

varstart[i] += varstart[i-1] 

 

# This will be the coefficient matrix for the system of equations. We 

# start with all zeros and will fill in as we go. We think of this 

# matrix as acting on the right so the columns correspond to equations, 

# the rows correspond to variables, and .kernel() will give a right 

# kernel as is needed. 

from sage.matrix.constructor import Matrix 

coef_mat = Matrix(codomain.base_ring(), varstart[-1], eqs) 

 

# eqn keeps track of what equation we are on. If the maps X and Y are 

# assigned to an edge e and A and B are the matrices of variables that 

# describe the generic maps at the initial and final vertices of e 

# then commutativity of the edge diagram is described by the equation 

# AY = XB, or 

# 

# Sum_k A_ik*Y_kj - Sum_k X_ik*B_kj == 0 for all i and j. 

# 

# Below we loop through these values of i,j,k and write the 

# coefficients of the equation above into the coefficient matrix. 

eqn = 0 

for e in domain._semigroup._sorted_edges: 

X = domain._maps[e].matrix() 

Y = codomain._maps[e].matrix() 

for i in range(0, X.nrows()): 

for j in range(0, Y.ncols()): 

for k in range(0, Y.nrows()): 

coef_mat[varstart[verts.index(e[0])] + i*Y.nrows() + k, eqn] = Y[k, j] 

for k in range(0, X.ncols()): 

coef_mat[varstart[verts.index(e[1])] + k*Y.ncols() + j, eqn] = -X[i, k] 

eqn += 1 

 

# Now we can create the hom space 

self._space = coef_mat.kernel() 

 

# Bind identity if domain = codomain 

if domain is codomain: 

self.identity = self._identity 

 

@cached_method 

def zero(self): 

""" 

Return the zero morphism. 

 

.. NOTE:: 

 

It is needed to override the method inherited from 

the category of modules, because it would create 

a morphism that is of the wrong type and does not 

comply with :class:`~sage.quivers.morphism.QuiverRepHom`. 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1)) 

sage: H.zero() + H.an_element() == H.an_element() 

True 

sage: isinstance(H.zero(), H.element_class) 

True 

""" 

return self() 

 

def _coerce_map_from_(self, other): 

r""" 

A coercion exists if and only if ``other``` is also a 

QuiverHomSpace and there is a coercion from the domain of ``self`` 

to the domain of ``other`` and from the codomain of ``other`` to 

the codomain of ``self```. 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a']}}).path_semigroup() 

sage: P = Q.P(QQ, 1) 

sage: S = Q.S(QQ, 1) 

sage: H1 = P.Hom(S) 

sage: H2 = (P/P.radical()).Hom(S) 

sage: H1.coerce_map_from(H2) # indirect doctest 

Coercion map: 

From: Dimension 1 QuiverHomSpace 

To: Dimension 1 QuiverHomSpace 

""" 

 

if not isinstance(other, QuiverHomSpace): 

return False 

if not other._domain.has_coerce_map_from(self._domain): 

return False 

if not self._codomain.has_coerce_map_from(other._codomain): 

return False 

return True 

 

def __call__(self, *data, **kwds): 

r""" 

A homomorphism of quiver representations (of one and the same 

quiver) is given by specifying, for each vertex of the quiver, a 

homomorphism of the spaces assigned to this vertex such that these 

homomorphisms commute with the edge maps. The domain and codomain 

of the homomorphism are required to be representations over the 

same quiver with the same base ring. 

 

INPUT: 

 

Usually, one would provide a single dict, list, 

:class:`QuiverRepElement` or :class:`QuiverRepHom` as arguments. 

The semantics is as follows: 

 

- list: ``data`` can be a list of images for the generators of 

the domain. "Generators" means the output of the ``gens()`` 

method. An error will be generated if the map so defined 

is not equivariant with respect to the action of the quiver. 

- dictionary: ``data`` can be a dictionary associating to each 

vertex of the quiver either a homomorphism with domain and 

codomain the spaces associated to this vertex in the domain 

and codomain modules respectively, or a matrix defining such 

a homomorphism, or an object that sage can construct such a 

matrix from. Not all vertices must be specified, unspecified 

vertices are assigned the zero map, and keys not corresponding 

to vertices of the quiver are ignored. An error will be 

generated if these maps do not commute with the edge maps of 

the domain and codomain. 

- :class:`QuiverRepElement`: if the domain is a 

:class:`QuiverRep_with_path_basis` then ``data`` can be a single 

:class:`QuiverRepElement` belonging to the codomain. The map 

is then defined by sending each path, ``p``, in the basis 

to ``data*p``. If ``data`` is not an element of the codomain or 

the domain is not a :class:`QuiverRep_with_path_basis` then 

an error will be generated. 

- :class:`QuiverRepHom`: the input can also be a map `f : D \to C` 

such that there is a coercion from the domain of ``self`` to ``D`` 

and from ``C`` to the codomain of ``self``. The composition 

of these maps is the result. 

 

If there additionally are keyword arguments or if a 

:class:`QuiverRepHom` can not be created from the data, then the 

default call method of :class:`~sage.categories.homset.Homset` 

is called instead. 

 

OUTPUT: 

 

- :class:`QuiverRepHom` 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}, 2:{3:['c']}}).path_semigroup() 

sage: spaces = {1: QQ^2, 2: QQ^2, 3:QQ^1} 

sage: maps = {(1, 2, 'a'): [[1, 0], [0, 0]], (1, 2, 'b'): [[0, 0], [0, 1]], (2, 3, 'c'): [[1], [1]]} 

sage: M = Q.representation(QQ, spaces, maps) 

sage: spaces2 = {2: QQ^1, 3: QQ^1} 

sage: S = Q.representation(QQ, spaces2) 

sage: H = S.Hom(M) 

 

With no additional data this creates the zero map:: 

 

sage: f = H() # indirect doctest 

sage: f.is_zero() 

True 

 

We must specify maps at the vertices to get a nonzero 

homomorphism. Note that if the dimensions of the spaces assigned 

to the domain and codomain of a vertex are equal then Sage will 

construct the identity matrix from ``1``:: 

 

sage: maps2 = {2:[1, -1], 3:1} 

sage: g = H(maps2) # indirect doctest 

 

Here we create the same map by specifying images for the generators:: 

 

sage: x = M({2: (1, -1)}) 

sage: y = M({3: (1,)}) 

sage: h = H([x, y]) # indirect doctest 

sage: g == h 

True 

 

Here is an example of the same with a bigger identity matrix:: 

 

sage: spaces3 = {2: QQ^2, 3: QQ^2} 

sage: maps3 = {(2, 3, 'c'): [[1, 0], [1, 0]]} 

sage: S3 = Q.representation(QQ, spaces3, maps3) 

sage: h3 = S3.Hom(M)({2: 1, 3: [[1], [0]]}) 

sage: h3.get_map(2) 

Vector space morphism represented by the matrix: 

[1 0] 

[0 1] 

Domain: Vector space of dimension 2 over Rational Field 

Codomain: Vector space of dimension 2 over Rational Field 

 

If the domain is a module of type :class:`QuiverRep_with_path_basis` 

(for example, the indecomposable projectives) we can create maps by 

specifying a single image:: 

 

sage: Proj = Q.P(GF(7), 3) 

sage: Simp = Q.S(GF(7), 3) 

sage: im = Simp({3: (1,)}) 

sage: H2 = Proj.Hom(Simp) 

sage: H2(im).is_surjective() # indirect doctest 

True 

""" 

if kwds or (len(data)>1): 

return super(Homset,self).__call__(*data,**kwds) 

 

if not data: 

return self.natural_map() 

 

data0 = data[0] 

if data0 is None or data0 == 0: 

data0 = {} 

try: 

return self.element_class(self._domain, self._codomain, data0) 

except (TypeError, ValueError): 

return super(QuiverHomSpace,self).__call__(*data,**kwds) 

 

def _repr_(self): 

""" 

Default string representation. 

 

TESTS:: 

 

sage: Q = DiGraph({1:{2:['a']}}).path_semigroup() 

sage: Q.P(GF(3), 2).Hom(Q.S(GF(3), 2)) # indirect doctest 

Dimension 1 QuiverHomSpace 

""" 

return "Dimension {} QuiverHomSpace".format(self._space.dimension()) 

 

def natural_map(self): 

""" 

The natural map from domain to codomain. 

 

This is the zero map. 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}, 2:{3:['c']}}).path_semigroup() 

sage: spaces = {1: QQ^2, 2: QQ^2, 3:QQ^1} 

sage: maps = {(1, 2, 'a'): [[1, 0], [0, 0]], (1, 2, 'b'): [[0, 0], [0, 1]], (2, 3, 'c'): [[1], [1]]} 

sage: M = Q.representation(QQ, spaces, maps) 

sage: spaces2 = {2: QQ^1, 3: QQ^1} 

sage: S = Q.representation(QQ, spaces2) 

sage: S.hom(M) # indirect doctest 

Homomorphism of representations of Multi-digraph on 3 vertices 

sage: S.hom(M) == S.Hom(M).natural_map() 

True 

""" 

return self.element_class(self._domain, self._codomain, {}) 

 

def _identity(self): 

""" 

Return the identity map. 

 

OUTPUT: 

 

- :class:`QuiverRepHom` 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a']}}).path_semigroup() 

sage: P = Q.P(QQ, 1) 

sage: H = P.Hom(P) 

sage: f = H.identity() # indirect doctest 

sage: f.is_isomorphism() 

True 

""" 

from sage.matrix.constructor import Matrix 

maps = dict((v, Matrix(self._domain._spaces[v].dimension(), 

self._domain._spaces[v].dimension(), self._base.one())) 

for v in self._quiver) 

return self.element_class(self._domain, self._codomain, maps) 

 

########################################################################### 

# # 

# ACCESS FUNCTIONS # 

# These functions are used to view and modify the representation data. # 

# # 

########################################################################### 

 

def base_ring(self): 

""" 

Return the base ring of the representations. 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1)) 

sage: H.base_ring() 

Rational Field 

""" 

return self._base 

 

def quiver(self): 

""" 

Return the quiver of the representations. 

 

OUTPUT: 

 

- :class:`DiGraph`, the quiver of the representations 

 

EXAMPLES:: 

 

sage: P = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: H = P.S(QQ, 2).Hom(P.P(QQ, 1)) 

sage: H.quiver() is P.quiver() 

True 

""" 

return self._quiver 

 

def domain(self): 

""" 

Return the domain of the hom space. 

 

OUTPUT: 

 

- :class:`QuiverRep`, the domain of the Hom space 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: S = Q.S(QQ, 2) 

sage: H = S.Hom(Q.P(QQ, 1)) 

sage: H.domain() is S 

True 

""" 

return self._domain 

 

def codomain(self): 

""" 

Return the codomain of the hom space. 

 

OUTPUT: 

 

- :class:`QuiverRep`, the codomain of the Hom space 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: P = Q.P(QQ, 1) 

sage: H = Q.S(QQ, 2).Hom(P) 

sage: H.codomain() is P 

True 

""" 

return self._codomain 

 

########################################################################### 

# # 

# DATA FUNCTIONS # 

# These functions return data collected from the representation. # 

# # 

########################################################################### 

 

def dimension(self): 

""" 

Return the dimension of the hom space. 

 

OUTPUT: 

 

- integer, the dimension 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1)) 

sage: H.dimension() 

2 

""" 

return self._space.dimension() 

 

def gens(self): 

""" 

Return a list of generators of the hom space (as a `k`-vector 

space). 

 

OUTPUT: 

 

- list of :class:`QuiverRepHom` objects, the generators 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1)) 

sage: H.gens() 

[Homomorphism of representations of Multi-digraph on 2 vertices, 

Homomorphism of representations of Multi-digraph on 2 vertices] 

""" 

return [self.element_class(self._domain, self._codomain, f) 

for f in self._space.gens()] 

 

def coordinates(self, hom): 

""" 

Return the coordinates of the map when expressed in terms of the 

generators (i. e., the output of the ``gens`` method) of the 

hom space. 

 

INPUT: 

 

- ``hom`` -- :class:`QuiverRepHom` 

 

OUTPUT: 

 

- list, the coordinates of the given map when written in terms of the 

generators of the :class:`QuiverHomSpace` 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: S = Q.S(QQ, 2) 

sage: P = Q.P(QQ, 1) 

sage: H = S.Hom(P) 

sage: f = S.hom({2: [[1,-1]]}, P) 

sage: H.coordinates(f) 

[1, -1] 

""" 

#Use the coordinates function on space 

return self._space.coordinates(hom._vector) 

 

########################################################################### 

# # 

# CONSTRUCTION FUNCTIONS # 

# These functions create and return modules and homomorphisms. # 

# # 

########################################################################### 

 

def _an_element_(self): 

""" 

Return a homomorphism in the Hom space. 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() 

sage: S = Q.S(QQ, 2) 

sage: P = Q.P(QQ, 1) 

sage: H = S.Hom(P) 

sage: H.an_element() in H # indirect doctest 

True 

""" 

return self.element_class(self._domain, self._codomain, self._space.an_element()) 

 

def left_module(self, basis=False): 

""" 

Create the QuiverRep of ``self`` as a module over the opposite 

quiver. 

 

INPUT: 

 

- ``basis`` - bool. If ``False``, then only the module is 

returned. If ``True``, then a tuple is returned. The first 

element is the QuiverRep and the second element is a 

dictionary which associates to each vertex a list. The 

elements of this list are the homomorphisms which correspond to 

the basis elements of that vertex in the module. 

 

OUTPUT: 

 

- :class:`QuiverRep` or tuple 

 

.. WARNING:: 

 

The codomain of the Hom space must be a left module. 

 

.. NOTE:: 

 

The left action of a path `e` on a map `f` is given by 

`(ef)(m) = ef(m)`. This gives the Hom space its structure as 

a left module over the path algebra. This is then converted to 

a right module over the path algebra of the opposite quiver 

``Q.reverse()`` and returned. 

 

EXAMPLES:: 

 

sage: Q = DiGraph({1:{2:['a', 'b'], 3: ['c', 'd']}, 2:{3:['e']}}).path_semigroup() 

sage: P = Q.P(GF(3), 3) 

sage: A = Q.free_module(GF(3)) 

sage: H = P.Hom(A) 

sage: H.dimension() 

6 

sage: M, basis_dict = H.left_module(true) 

sage: M.dimension_vector() 

(4, 1, 1) 

sage: Q.reverse().P(GF(3), 3).dimension_vector() 

(4, 1, 1) 

 

As lists start indexing at 0 the `i`-th vertex corresponds to the 

`(i-1)`-th entry of the dimension vector:: 

 

sage: len(basis_dict[2]) == M.dimension_vector()[1] 

True 

""" 

from sage.quivers.representation import QuiverRep 

if not self._codomain.is_left_module(): 

raise ValueError("the codomain must be a left module") 

 

# Create the spaces 

spaces = {} 

for v in self._quiver: 

im_gens = [self([self._codomain.left_edge_action((v, v), f(x)) 

for x in self._domain.gens()])._vector 

for f in self.gens()] 

spaces[v] = self._space.submodule(im_gens) 

 

# Create the maps 

maps = {} 

for e in self._semigroup._sorted_edges: 

e_op = (e[1], e[0], e[2]) 

maps[e_op] = [] 

for vec in spaces[e[1]].gens(): 

vec_im = spaces[e_op[1]].coordinate_vector(self([self._codomain.left_edge_action(e, self(vec)(x)) 

for x in self._domain.gens()])._vector) 

maps[e_op].append(vec_im) 

 

# Create and return the module (and the dict if desired) 

if basis: 

basis_dict = {} 

for v in self._quiver: 

basis_dict[v] = [self.element_class(self._domain, self._codomain, vec) 

for vec in spaces[v].gens()] 

return (QuiverRep(self._base, self._semigroup.reverse(), spaces, maps), basis_dict) 

else: 

return QuiverRep(self._base, self._semigroup.reverse(), spaces, maps)