Controllers
This page provides the documentation for the controllers used by the Application.
TiBi.controllers.AppController
¶
Bases: QObject
Main application controller.
This controller serves as a high-level coordinator in the application, handling communication between different subsystems. It connects signals from various controllers and routes requests to appropriate handlers, ensuring that components remain decoupled from each other.
Attributes:
Name | Type | Description |
---|---|---|
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
bz_plot_controller |
BrillouinZonePlotController
|
Controller of the Broullouin zone graphical component |
computation_controller |
ComputationController
|
Controller orchestrating computations |
main_ui_controller |
MainUIController
|
Controller in charge of menus and toolbars |
plot_controller |
PlotController
|
Controller of the results graphical component |
uc_controller |
UnitCellController
|
Controller in charge of |
uc_plot_controller |
UnitCellPlotController
|
Controller of the |
Source code in TiBi/controllers/app_controller.py
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 |
|
TiBi.controllers.bands_controller.BandsController
¶
Bases: QObject
Controller for the hopping parameter interface.
Attributes:
Name | Type | Description |
---|---|---|
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
bands_panel |
BandsPanel
|
Main panel for bands and BZ grid calculations |
bands_plot_requested |
Signal
|
Request band plots update. |
dos_plot_requested |
Signal
|
Request DOS plots update. |
status_updated |
Signal(str)
|
Update the status bar information. |
Methods:
Name | Description |
---|---|
get_dos_properties |
Get the DOS properties for the plots. |
get_projection_indices |
Get the states selected for projection from the dropdown menu. |
update_bands_panel |
Update the |
update_combo |
Update the states in the combo box. |
Source code in TiBi/controllers/bands_controller.py
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 |
|
get_dos_properties()
¶
Get the DOS properties for the plots.
Returns:
Type | Description |
---|---|
tuple[int, int, float64]
|
Number of bins/points to be used in the plot, the plot type (0 for a histogram, 1 for Lorentzian), and Lorentzian broadening |
Source code in TiBi/controllers/bands_controller.py
502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
|
get_projection_indices()
¶
Get the indices of the selected states from the projection menu.
Returns:
Type | Description |
---|---|
list[int]
|
Indices of the selected states |
Source code in TiBi/controllers/bands_controller.py
491 492 493 494 495 496 497 498 499 500 |
|
update_bands_panel()
¶
Update the BandsPanel
.
The UI components are activated/deactivated based on the system parameters. Projection menu is also updated programmatically. Selection is set to "bands"
Source code in TiBi/controllers/bands_controller.py
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 |
|
update_combo()
¶
Update the states in the combo box.
Once the items are updated, the selection buttons are activated if the number of items is not zero. Additionally, all the items are selected programatically.
Source code in TiBi/controllers/bands_controller.py
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
|
TiBi.controllers.BrillouinZonePlotController
¶
Bases: QObject
Controller for the Brillouin zone plot view.
This controller manages the 3D visualization of the Brillouin zone. It handles the visualization of selected high-symmetry points within the BZ and paths for band structure calculations.
The controller observes two views: BZ plot itself and a panel in the computation view which allows one to select BZ points and create path.
Attributes:
Name | Type | Description |
---|---|---|
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
bz_plot_view |
BrillouinZonePlotView
|
The view component for displaying the Brillouin zone |
computation_view |
ComputationView
|
The view component that contains controls for creating a path in the BZ |
undo_stack |
QUndoStack
|
|
unit_cell |
UnitCell
|
The currently selected unit cell |
bz_plot_items |
dict
|
Dictionary to store plot items |
dim |
int
|
Dimensionality of the Brillouin zone |
bz_point_selection |
dict
|
Indices of the selected high-symmetry points in the BZ |
bz_point_lists |
dict
|
Lists of high-symmetry points, grouped by type |
bz_path_updated |
Signal
|
Emitted when the BZ special points path is updated by adding or removing points. Triggers a redraw of the path in the plot. |
Methods:
Name | Description |
---|---|
update_brillouin_zone |
Draw the Brillouin zone of the selected |
Source code in TiBi/controllers/bz_plot_controller.py
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 |
|
update_brillouin_zone()
¶
Draw the Brillouin zone of the selected UnitCell
.
This method is the core rendering function that: 1. Clears any existing visualization 2. Calculates the Brillouin zone vertices and faces 3. Renders the BZ wireframe and key points (Gamma, vertices, edge midpoints, face centers) 4. Updates UI controls based on the dimensionality of the BZ
The method is triggered whenever the UnitCell
changes or
a new unit cell is selected.
Source code in TiBi/controllers/bz_plot_controller.py
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 |
|
TiBi.controllers.ComputationController
¶
Bases: QObject
Controller responsible for physics calculations within the application.
Attributes:
Name | Type | Description |
---|---|---|
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
computation_view |
ComputationView
|
UI object containing the computation view |
hopping_controller |
HoppingController
|
Child controller in charge of the hopping panel of the computation UI |
bands_controller |
BandsController
|
Child controller in charge of the bands panel of the computation UI |
status_updated |
Signal(str)
|
Signal emitted to update the status of the computation |
bands_plot_requested |
Signal
|
Request bands plot.
Re-emitting signal from |
dos_plot_requested |
Signal
|
Request DOS plot.
Re-emitting signal from |
hopping_segments_requested |
Signal
|
Signal requesting the plotting of hopping segments in the
unit cell plot. Re-emitting signal for the |
selection_requested |
Signal(object, object, object)
|
Signal requesting a programmatic selection. Re-emitting signal for
the |
Methods:
Name | Description |
---|---|
get_dos_properties |
Get the number of bins/points, plot type, and broadening. |
get_pair_selection |
Get the selected state pair from the hopping matrix, if any. |
get_projection_indices |
Get the projection indices from the projection combo. |
update_bands_panel |
Update the bands UI panel. |
update_hopping_panel |
Redraw the hoppings UI panel. |
update_projection_combo |
Update the projection combo in the bands panel. |
Source code in TiBi/controllers/computation_controller.py
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 |
|
get_dos_properties()
¶
Get the number of bins/points, plot type, and broadening.
Returns:
Type | Description |
---|---|
tuple[int, int]
|
Number of bins/points to be used in the plot and the plot type (0 for a histogram, 1 for Lorentzian) |
Source code in TiBi/controllers/computation_controller.py
146 147 148 149 150 151 152 153 154 155 156 |
|
get_pair_selection()
¶
Get the selected state pair from the hopping matrix, if any.
Returns:
Type | Description |
---|---|
list[tuple] | list[None]
|
List of selected states, if available, where the elements of the list are (site_name, site_id, state_name, state_id). |
Source code in TiBi/controllers/computation_controller.py
107 108 109 110 111 112 113 114 115 116 117 |
|
get_projection_indices()
¶
Get the projection indices from the projection combo.
Source code in TiBi/controllers/computation_controller.py
140 141 142 143 144 |
|
update_bands_panel()
¶
Update the bands UI panel.
Source code in TiBi/controllers/computation_controller.py
128 129 130 131 132 |
|
update_hopping_panel()
¶
Redraw the hoppings UI panel.
This method is called when the user renames a tree item to make sure that the matrix table contains the correct item names.
Source code in TiBi/controllers/computation_controller.py
119 120 121 122 123 124 125 126 |
|
update_projection_combo()
¶
Update the projection combo in the bands panel.
Source code in TiBi/controllers/computation_controller.py
134 135 136 137 138 |
|
TiBi.controllers.hopping_controller.HoppingController
¶
Bases: QObject
Controller for the hopping parameter interface.
This controller manages the creation and editing of hopping parameters (tight-binding matrix elements) between quantum states. It handles:
- The interactive matrix grid where each button represents a possible hopping between two states
- The detailed parameter table for editing specific hopping values
- The right-click context menu for performing operations like creating Hermitian partners
Attributes:
Name | Type | Description |
---|---|---|
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
hopping_view |
HoppingPanel
|
The main view component |
undo_stack |
QUndoStack
|
|
state_info |
list[tuple]
|
List of tuples with state information (site_name, site_id, state_name, state_id) for each |
pair_selection |
list[tuple]
|
2-element list of tuples containing the selected state pair |
hoppings |
dict[tuple[uuid, uuid], list[tuple[tuple[int, int, int], complex128]]]
|
Dictionary containing the hopping parameters for the |
btn_clicked |
Signal(object, object)
|
Emitted when a hopping button is clicked. The Signal carries the source and destination state info following the (site_name, site_id, state_name, state_id) format. |
hoppings_changed |
Signal(object, object, object, object, object)
|
Emitted by the command when couplings are modified. The signal carries the information about the current item selection, as well as the selection of the state pair. It triggers a table and matrix update. |
hopping_segments_requested |
Signal
|
Emitted when the coupling table is updated, triggering an update of hopping segments. |
selection_requested |
Signal(object, object, object)
|
Emitted when the selection change in the tree is required, carrying the unit cell, site, and state IDs. |
Methods:
Name | Description |
---|---|
update_unit_cell |
Update the hopping data model with the |
Source code in TiBi/controllers/hopping_controller.py
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 |
|
update_unit_cell()
¶
Update the hopping data model with the selected UnitCell
's hoppings.
This method is called when the selection changes in the tree view. It retrieves the currently selected unit cell and its hoppings, refreshing the matrix.
Source code in TiBi/controllers/hopping_controller.py
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 |
|
TiBi.controllers.MainUIController
¶
Bases: QObject
Controller for the main UI components (menu bar, toolbar, status bar).
This controller connects the UI elements to the application logic and manages the action manager that provides shared actions to the menu bar and toolbar.
Attributes:
Name | Type | Description |
---|---|---|
project_path |
str | None
|
The file to which the dictionary containing the unit cell objects is saved |
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
main_window |
MainWindow
|
Subclass of QMainWindow containing the application's main view |
menu_bar_view |
MenuBarView
|
Standard menu bar |
toolbar_view |
MainToolbarView
|
Toolbar at the top of the application window |
status_bar_view |
StatusBarView
|
Status bar at the bottom of the application window |
undo_stack |
QUndoStack
|
Stack for 'undo-able' actions |
project_refresh_requested |
Signal
|
Request to refresh the project view after loading or creating a new one |
unit_cell_update_requested |
Signal
|
Request to update the unit cell plot with new parameters |
Methods:
Name | Description |
---|---|
get_uc_plot_properties |
Get the unit cell visualization properties. |
set_spinbox_status |
Activate/deactivate unit cell spinboxes. |
update_status |
Display a message in the status bar. |
Source code in TiBi/controllers/main_ui_controller.py
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 |
|
get_uc_plot_properties()
¶
Get the unit cell visualization properties.
The function returns the number of unit cells to be plotted along each basis vector, as well as whether the wireframe is plotted.
Returns:
Type | Description |
---|---|
(int, int, int, bool)
|
Numbers of unit cells along each of the three vectors and a boolean for the wireframe. |
Source code in TiBi/controllers/main_ui_controller.py
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 |
|
set_spinbox_status(n1_enabled, n2_enabled, n3_enabled)
¶
Activate/deactivate the unit cell spinboxes
Source code in TiBi/controllers/main_ui_controller.py
164 165 166 167 168 |
|
update_status(message)
¶
Display a message in the status bar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Message to display |
required |
Source code in TiBi/controllers/main_ui_controller.py
324 325 326 327 328 329 330 331 332 333 |
|
TiBi.controllers.PlotController
¶
Bases: QObject
Controller for the 2D plot view.
Attributes:
Name | Type | Description |
---|---|---|
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
plot_view |
PlotView
|
2D plot for displaying computed results. |
Methods:
Name | Description |
---|---|
plot_band_structure |
Plot the band structure for the selected unit cell. |
plot_dos |
Plot the density of states for the selected unit cell. |
Source code in TiBi/controllers/plot_controller.py
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 |
|
plot_band_structure(states)
¶
Plot the band structure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
states
|
list[int]
|
List of integers denoting onto which states the bands need to be projected. |
required |
Source code in TiBi/controllers/plot_controller.py
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 |
|
plot_dos(num_bins, states, plot_type, broadening)
¶
Plot the density of states using the Brillouin zone grid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_bins
|
int
|
Number of histogram bins |
required |
states
|
list[int]
|
List of integers denoting onto which states the bands need to be projected. |
required |
plot_type
|
int
|
Histogram (0) or Lorentzian (1) |
required |
broadening
|
float64
|
Broadening parameter for the Lorentzian DOS |
required |
Source code in TiBi/controllers/plot_controller.py
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 |
|
TiBi.controllers.UnitCellController
¶
Bases: QObject
Controller managing the UnitCell
, Site
, and State
creation panel.
Attributes:
Name | Type | Description |
---|---|---|
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
unit_cell_view |
UnitCellView
|
The main view component |
undo_stack |
QUndoStack
|
|
v1, v2, v3 |
list[EnterKeySpinBox]
|
Lists of spinboxes for basis vector components |
R, c1, c2, c3 |
EnterKeySpinBox
|
Spinboxes for site properties |
tree_view_panel |
TreeViewPanel
|
The tree view panel component |
tree_view |
SystemTree
|
The tree view component |
tree_model |
QStandardItemModel
|
The model backing the tree view |
unit_cell_parameter_changed |
Signal
|
Signal emitted when a unit cell parameter is changed. This triggers a redraw of the panels orchestrated by the app_controller. Whenever unit cell parameter changes, the derived quantities (band structure, BZ grid, etc), are discarded due to being stale. The clearing is handled by the associated commands. |
site_parameter_changed |
Signal
|
Signal emitted when a site parameter is changed. This triggers a redraw only of the unit cell plot. Changing site parameters does not invalidate the derived quantities since the site parameters are purely cosmetic. |
hopping_projection_update_requested |
Signal
|
Signal emitted when a tree item is renamed or the structure of the unit cell changes (adding/removing states), requiring an update of the hopping matrix and the projection selection. |
Methods:
Name | Description |
---|---|
refresh_tree |
Redraw the system tree using the current system state. |
select_item |
Select a tree item using the ID's. |
Source code in TiBi/controllers/uc_controller.py
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 |
|
refresh_tree()
¶
Redraw the system tree using the current system state.
Source code in TiBi/controllers/uc_controller.py
421 422 423 424 425 |
|
select_item(uc_id, site_id, state_id)
¶
Select a tree item using the ID's.
Source code in TiBi/controllers/uc_controller.py
427 428 429 430 431 |
|
TiBi.controllers.UnitCellPlotController
¶
Bases: QObject
Controller for the unit cell 3D visualization.
This controller manages the 3D visualization of unit cells, handling the rendering of unit cell wireframes, site positions, and periodic repetitions.
Attributes:
Name | Type | Description |
---|---|---|
unit_cells |
dict[UUID, UnitCell]
|
Dictionary mapping UUIDs to UnitCell objects |
selection |
Selection
|
Model tracking the currently selected unit cell, site, and state |
uc_plot_view |
UnitCellPlotView
|
The view component for the 3D visualization |
unit_cell |
UnitCell
|
The unit cell currently being visualized |
uc_plot_items |
dict
|
Dictionary to store plot items |
Methods:
Name | Description |
---|---|
update_hopping_segments |
Draw segments to indicate hopping connections. |
update_unit_cell |
Draw the selected |
Source code in TiBi/controllers/uc_plot_controller.py
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 |
|
update_hopping_segments(pair_selection)
¶
Draw segments to indicate hopping connections.
When a pair is selected from the hopping matrix, this function draws lines starting from the site hosting the source state inside the unit cell around (0,0,0) to all the sites hosting the target sites.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair_selection
|
tuple
|
A tuple of (site_name, site_id, state_name, state_id) representing the selected pair of states. The first element is the source state and the second element is the target state. |
required |
Source code in TiBi/controllers/uc_plot_controller.py
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 |
|
update_unit_cell(wireframe_shown, n1, n2, n3)
¶
Draw the selected UnitCell
in the 3D view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wireframe_shown
|
bool
|
Denotes whether the primitive vector wireframe is drawn |
required |
n1
|
int
|
Number of repetitions along the corresponding basis vector |
required |
n2
|
int
|
Number of repetitions along the corresponding basis vector |
required |
n3
|
int
|
Number of repetitions along the corresponding basis vector |
required |
Source code in TiBi/controllers/uc_plot_controller.py
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 |
|