Skip to content

Instantly share code, notes, and snippets.

@danlkv
Last active June 5, 2020 21:15

Revisions

  1. danlkv revised this gist Jun 5, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -15,11 +15,11 @@

    Simulator program: `tensim`

    - Simply simulate a circuit:
    1. Simply simulate a circuit:
    ```bash
    cat circuit | tensim > result
    ```
    - Simulate a circuit in a wierd format
    1. Simulate a circuit in a wierd format
    ```bash
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    @@ -37,14 +37,14 @@ Simulator program: `tensim`
    ```


    - Simulate **N** generated circuits in one command
    3. Simulate **N** generated circuits in one command
    ```bash
    generate_circ -n 1 >> circuits
    generate_circ -n 2 >> circuits
    ....
    cat circuits | tensim > results
    ```
    - Simulate circuit based on Hamiltonian composed of tensor network, not gates
    4. Simulate circuit based on Hamiltonian composed of tensor network, not gates
    ```bash
    gen_tensor_net | tensim optimize | tensim simulate > result
    ```
  2. danlkv revised this gist Jun 5, 2020. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -16,35 +16,35 @@
    Simulator program: `tensim`

    - Simply simulate a circuit:
    ```
    ```bash
    cat circuit | tensim > result
    ```
    - Simulate a circuit in a wierd format
    ```
    ```bash
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    1. **Q:** Why not `tensim --input-fmt wierd`?

    **A:** Because we might have other actions working with this format
    ```
    cat circuit tensim parse -f wierd | visualise-circ > circ.png
    ```bash
    cat circuit | tensim parse -f wierd | visualise-circ > circ.png
    ```
    1. **Q:** Why not `tensim --input circuit`, but `cat circuit | tensim`?

    **A:** Because we can a) process many circuits line-by-line and b) connect with other tools
    ```
    ```bash
    connect_to_db --table circuits | tensim > results
    ```


    - Simulate **N** generated circuits in one command
    ```
    ```bash
    generate_circ -n 1 >> circuits
    generate_circ -n 2 >> circuits
    ....
    cat circuits | tensim > results
    ```
    - Simulate circuit based on Hamiltonian composed of tensor network, not gates
    ```
    ```bash
    gen_tensor_net | tensim optimize | tensim simulate > result
    ```
  3. danlkv revised this gist Jun 5, 2020. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,11 @@ Simulator program: `tensim`
    ```
    1. **Q:** Why not `tensim --input circuit`, but `cat circuit | tensim`?

    **A:** Because we can process many circuits line-by line
    **A:** Because we can a) process many circuits line-by-line and b) connect with other tools
    ```
    connect_to_db --table circuits | tensim > results
    ```
    - Simulate **N** generated circuits in one command
    ```
  4. danlkv revised this gist Jun 5, 2020. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -23,12 +23,15 @@ Simulator program: `tensim`
    ```
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    1. Why not `tensim --input-fmt wierd`?
    1. **Q:** Why not `tensim --input-fmt wierd`?

    Because we might have other actions working with this format
    **A:** Because we might have other actions working with this format
    ```
    cat circuit tensim parse -f wierd | visualise-circ > circ.png
    ```
    1. **Q:** Why not `tensim --input circuit`, but `cat circuit | tensim`?

    **A:** Because we can process many circuits line-by line

    - Simulate **N** generated circuits in one command
    ```
  5. danlkv revised this gist Jun 5, 2020. 1 changed file with 17 additions and 12 deletions.
    29 changes: 17 additions & 12 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -16,23 +16,28 @@
    Simulator program: `tensim`

    - Simply simulate a circuit:
    ```
    cat circuit | tensim > result
    ```
    ```
    cat circuit | tensim > result
    ```
    - Simulate a circuit in a wierd format
    ```
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    1. Why not `tensim --input-fmt wierd`?

    Because we might have other actions working with this format
    ```
    cat circuit tensim parse -f wierd | visualise-circ > circ.png
    ```

    - Simulate **N** generated circuits in one command
    ```
    generate_circ -n 1 >> circuits
    generate_circ -n 2 >> circuits
    ....
    cat circuits | tensim > results
    ```
    ```
    generate_circ -n 1 >> circuits
    generate_circ -n 2 >> circuits
    ....
    cat circuits | tensim > results
    ```
    - Simulate circuit based on Hamiltonian composed of tensor network, not gates
    ```
    gen_tensor_net | tensim optimize | tensim simulate > result
    ```
    ```
    gen_tensor_net | tensim optimize | tensim simulate > result
    ```
  6. danlkv revised this gist Jun 5, 2020. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -20,8 +20,9 @@ Simulator program: `tensim`
    cat circuit | tensim > result
    ```
    - Simulate a circuit in a wierd format

    `cat circuit | tensim parse -f wierd | tensim > result`
    ```
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    1. Why not `tensim --input-fmt wierd`?

    - Simulate **N** generated circuits in one command
  7. danlkv revised this gist Jun 5, 2020. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -20,11 +20,9 @@ Simulator program: `tensim`
    cat circuit | tensim > result
    ```
    - Simulate a circuit in a wierd format
    ```
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    1. Why not `tensim --input-fmt wierd`?

    `cat circuit | tensim parse -f wierd | tensim > result`
    1. Why not `tensim --input-fmt wierd`?

    - Simulate **N** generated circuits in one command
    ```
  8. danlkv revised this gist Jun 5, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,8 @@ Simulator program: `tensim`
    ```
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    - Why not `tensim --input-fmt wierd`?
    1. Why not `tensim --input-fmt wierd`?

    - Simulate **N** generated circuits in one command
    ```
  9. danlkv revised this gist Jun 5, 2020. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -19,15 +19,20 @@ Simulator program: `tensim`
    ```
    cat circuit | tensim > result
    ```
    - Simulate a circuit in wierd format
    - Simulate a circuit in a wierd format
    ```
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    - Why not `tensim --input-fmt wierd`?

    - Simulate **N** generated circuits in one command
    ```
    generate_circ -n 1 >> circuits
    generate_circ -n 2 >> circuits
    ....
    cat circuits | tensim > results
    ```
    -
    - Simulate circuit based on Hamiltonian composed of tensor network, not gates
    ```
    gen_tensor_net | tensim optimize | tensim simulate > result
    ```
  10. danlkv revised this gist Jun 5, 2020. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -17,10 +17,12 @@ Simulator program: `tensim`

    - Simply simulate a circuit:
    ```
    cat circuit | tensim > result```
    cat circuit | tensim > result
    ```
    - Simulate a circuit in wierd format
    ```
    cat circuit | tensim parse -f wierd | tensim > result```
    cat circuit | tensim parse -f wierd | tensim > result
    ```
    - Simulate **N** generated circuits in one command
    ```
    generate_circ -n 1 >> circuits
  11. danlkv revised this gist Jun 5, 2020. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,11 @@
    Simulator program: `tensim`

    - Simply simulate a circuit:
    ```cat circuit | tensim > result```
    ```
    cat circuit | tensim > result```
    - Simulate a circuit in wierd format
    ```cat circuit | tensim parse -f wierd | tensim > result```
    ```
    cat circuit | tensim parse -f wierd | tensim > result```
    - Simulate **N** generated circuits in one command
    ```
    generate_circ -n 1 >> circuits
  12. danlkv revised this gist Jun 5, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,9 @@
    Simulator program: `tensim`

    - Simply simulate a circuit:
    `cat circuit | tensim > result`
    ```cat circuit | tensim > result```
    - Simulate a circuit in wierd format
    `cat circuit | tensim parse -f wierd | tensim > result`
    ```cat circuit | tensim parse -f wierd | tensim > result```
    - Simulate **N** generated circuits in one command
    ```
    generate_circ -n 1 >> circuits
  13. danlkv revised this gist Jun 5, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@

    - Parse the file
    - Simulate circuit
    - Optimise expression
    - Optimise expression (find ordering, slice, etc)
    - Actually simulate

    ### Example of usage
  14. danlkv revised this gist Jun 5, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    ### UNIX Philosophy

    1. Write programs that do one thing and do it well.
    1 Write programs to work together.
    1 Write programs to handle text streams, because that is a universal interface.
    1. Write programs to work together.
    1. Write programs to handle text streams, because that is a universal interface.

    ### Different concerns

  15. danlkv revised this gist Jun 5, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    ### UNIX Philosophy

    1. Write programs that do one thing and do it well.
    - Write programs to work together.
    - Write programs to handle text streams, because that is a universal interface.
    1 Write programs to work together.
    1 Write programs to handle text streams, because that is a universal interface.

    ### Different concerns

  16. danlkv created this gist Jun 5, 2020.
    29 changes: 29 additions & 0 deletions Tensim_API_thoughts.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    ### UNIX Philosophy

    1. Write programs that do one thing and do it well.
    - Write programs to work together.
    - Write programs to handle text streams, because that is a universal interface.

    ### Different concerns

    - Parse the file
    - Simulate circuit
    - Optimise expression
    - Actually simulate

    ### Example of usage

    Simulator program: `tensim`

    - Simply simulate a circuit:
    `cat circuit | tensim > result`
    - Simulate a circuit in wierd format
    `cat circuit | tensim parse -f wierd | tensim > result`
    - Simulate **N** generated circuits in one command
    ```
    generate_circ -n 1 >> circuits
    generate_circ -n 2 >> circuits
    ....
    cat circuits | tensim > results
    ```
    -