Example #1
0
def test_state_repr():
    state = State(ar(6))
    str(state)
    state = State(ar(6), parent=geom.graphene())
    str(state)
Example #2
0
def test_state_dkind():
    state = State(ar(6))
    assert state.dkind == 'f'
    state = State(ar(6).astype(np.complex128))
    assert state.dkind == 'c'
Example #3
0
def test_state_norm1():
    state = State(ar(6)).normalize()
    repr(state)
    assert len(state) == 1
    assert state.norm()[0] == pytest.approx(1)
    assert state.norm2()[0] == pytest.approx(1)
Example #4
0
def test_state_inner_differing_size():
    state1 = State(ar(8, 10))
    state2 = State(ar(4, 10))

    inner = state1.inner(state2, diag=False)
    assert inner.shape == (8, 4)