Quantum-Flytrap / bra-ket-vue

⟨𝜑|𝜓⟩.vue - a Vue-based visualization of quantum states and operations

Home Page:https://codesandbox.io/s/bra-ket-vue-cydtt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rectangular matrices don't work well

stared opened this issue · comments

As of 0.3.0, rectangular matrices do not work well:

image

new Vue({
  el: "#op-and",
  template: "<matrix-viewer :operator-raw='operator' :dark-mode='false' />",
  components: {
    MatrixViewer
  },
  data() {
  	return {
      operator: Operator.fromSparseCoordNames([
          ['0', '00', Cx(1)],
          ['0', '01', Cx(1)],
          ['0', '10', Cx(1)],
          ['1', '11', Cx(1)],
        ],
        [Dimension.position(2, 'bit')],
        [Dimension.position(2, 'bit'), Dimension.position(2, 'bit')])
		}
  }
})

image

new Vue({
  el: "#op-second",
  template: "<matrix-viewer :operator-raw='operator' :dark-mode='false' />",
  components: {
    MatrixViewer
  },
  data() {
  	return {
      operator: Operator.fromSparseCoordNames([
          ['0', '00', Cx(1)],
          ['1', '01', Cx(1)],
          ['0', '10', Cx(1)],
          ['1', '11', Cx(1)],
        ],
        [Dimension.position(2, 'bit')],
        [Dimension.position(2, 'bit'), Dimension.position(2, 'bit')])
		}
  }
})