How to install Povray on Ubuntu ?

Povray can be installed on an ubuntu machine in following steps :

  1. Open a terminal and do following commands.
    • sudo apt-get install build-essential
    • sudo-apt-get install libboost-all-dev
    • sudo apt-get install libtiff-dev
  2. Download the source from github. At the present (that is, June 2019), the stable povray version is 3.7 which can be downloaded from https://github.com/POV-Ray/povray/tree/3.7-stable.
  3. Extract the downloaded file. Open a terminal, cd into the extracted folder and do following commands:
    • cd unix
    • ./prebuild.sh
    • cd ..
    • ./configure COMPILED_BY=”your name <email@address>” (for example ./configure COMPILED_BY =”Harry Potter <harrypotter@hogwarts.edu>” )
    • make
    • sudo make install
  4. This is it ! If all the above commands finish without error, you will have povray installed on your system.

Python tkinter : Introduction 1.

There are many libraries in python which can be used for GUI development on various different platforms. Today we will talk about tkinter. The tkinter package is the de-facto standard Python interface to the Tk GUI toolkit, which is available on most systems including Unix and Windows. Here we give a few simple examples of how to use this package in python 3 for GUI development.

Hello world:

from tkinter import *
window = Tk()
window.title("Hello world !")
window.mainloop()

Labels, Text Input and Button

from tkinter import *
window = Tk()
window.geometry("450x150")
window.title("Label,Text Input and Button")
label1 = Label(window, text = "Name: ", width = 10)
label1.grid(column = 0, row = 0)
input_field = Entry(window, width =40)
input_field.grid(column = 1, row = 0)
label2 = Label(window, text = "", width = 40)
label2.grid(column=1, row=1)
def on_click():
    txt = "Your name is: " + input_field.get()
    label2.configure(text = txt)
button = Button(window, text = "ok", command = on_click)
button.grid(column=2, row=0)
window.mainloop()

Layout managers – pack, place and grid

Layout managers place, pack and grid are used in tkinter to arrange widgets on the screen. On each tkinter screen only one layout manager must be used.

Pack

With the pack layout manager, a widget’s precise position on screen need not be specified. A widget can be displayed on the screen by simply using the widget.pack() command, where in the brackets, one can also specify additional display options, as in the example below.

from tkinter import *
window = Tk()
window.geometry("400x400")
label1 = Label(window, text="One", bg="red", fg="white")
label1.pack()
label2 = Label(window, text="Two", bg="blue", fg="white")
label2.pack(fill=X) # with fill=X horizontal length will be streched to fill the window
label3 = Label(window, text="Three", bg="green", fg="black")
label3.pack(fill=X, padx=20) # padx for external horizontal padding 
label4 = Label(window, text="Four", bg="red", fg="black")
label4.pack() 
label5 = Label(window, text="Five", bg="red", fg="black")
label5.pack(ipadx = 10) # ipadx for internal horizontal padding
label6 = Label(window, text="Six", bg="blue", fg="white")
label6.pack(ipadx=10, ipady=10) # ipady for internal vertical padding 
label7 = Label(window, text="Seven", bg="green", fg="white")
label7.pack(fill=X, pady=10, ipady=5) # pady for external vertical padding

label8 = Label(window, text="Eight", bg="red", fg="white")
label8.pack(padx=5, pady=10, side=LEFT)
label9 = Label(window, text="Nine", bg="green", fg="white")
label9.pack(padx=5, pady=10, side=LEFT)
label10 = Label(window, text="Ten", bg="blue", fg="white")
label10.pack(padx=5, pady=10, side=LEFT)

labelb = Label(window, text=".......", bg="blue", fg="white")
labelb.pack(padx=5, pady=10, side=LEFT)

label11 = Label(window, text="go!", bg="red", fg="white")
label11.pack(padx=5, pady=10, side=RIGHT)
label12 = Label(window, text="we", bg="green", fg="white")
label12.pack(padx=5, pady=10, side=RIGHT)
label13 = Label(window, text="Here", bg="blue", fg="white")
label13.pack(padx=5, pady=10, side=RIGHT)
window.mainloop()

Place:

With Place layout manager the position and size of the widgets can be set explicitly.

from tkinter import *
window = Tk()

window.geometry("200x200")

label1 = Label(window, text = "This is", bg = 'black', fg = 'white')
label1.place(x=25, y=30, width = 150, height=30)
label2 = Label(window, text = "a test of", bg = 'black', fg = 'white')
label2.place(x=25, y=30 + 40, width = 150, height=30)
label3 = Label(window, text = "the place", bg = 'black', fg = 'white')
label3.place(x=25, y=30+ 2*40, width = 150, height=30)
label4 = Label(window, text = "layout manager.", bg = 'black', fg = 'white')
label4.place(x=25, y=30+3*40, width = 150, height=30)

window.mainloop()

Grid

Grid is similar to pack in the sense that there is not need to specify the precise position of widget on the screen. The difference from pack is that it arranges widgets in a grid of rows and columns.

from tkinter import *

window = Tk()
window.geometry("250x100")
user_info = ["first name", "last name", "address", "email"]

row_num = 0
for required_info in user_info:
    Label(window, text = required_info, anchor = E, width=10, padx=5).grid(row=row_num, column=0)
    Entry(window).grid(row=row_num, column=1)
    row_num += 1

window.mainloop()

Would we necessarily get gravitons on quantizing gravity ?

Whenever we have a classical theory with wavelike solutions, its  quantization generally gives the corresponding quantum particles. For  example, Maxwell’s theory of electromagnetism predicts the existence of  electromagnetic waves. So, when this classical theory is quantized we  get photons, the quanta of light. 

Similarly, Einstein’s  theory of gravity predicts the existence of gravitational waves.  Therefore, it is expected that a consistent quantization of gravity  would give gravitons, the quanta of gravity ( at least in the regime  where ‘nonperturbative’ effects are negligible ). 

However, if we  really ‘need’ to quantize gravity or not is a different question that  is still not understood very well. For example, there exist ideas like  “entropic gravity” in which the Einstein’s equations can be derived from  some thermodynamics considerations. If gravity is really some kind of  ‘entropic force’ then it would be conceptually wrong to try to quantise  it and hence there would be no gravitons.

Is phase velocity a physical observable ?

There are two types of waves in physics – 

1. Physical waves travelling through a material medium (e.g. sound waves or waves on the surface of water) 

2. Probability waves which are just mathematical functions whose mode square gives the probability of finding a particle in a given region of space. (e.g. EM waves can be thought of as probability waves associated with photons).

From the very definition of probability waves, their phase is not a physically observable quantity as the only physical information is contained in their mode square. Also, even though the phase velocity of probability waves can have observable consequences (for example the bending of light as it goes from one medium to another) it, in general, can’t be associated with the velocity at which the physical information is flowing. 

On the other hand, for physical waves the phase velocity (or group velocity if the wave is a linear combination of several simple waves) is not only a physically observable quantity but (from its very definition) it is also the velocity of the physical information (or disturbance) travelling through the medium.

Also see : https://en.wikipedia.org/wiki/Group_velocity

Is the Earth flat or round ?

The shape of a rigid body is not Lorentz invariant and depends on the frame of observation. Earth is almost spherical when observed from a frame which is at rest relative to it. On the other hand, if we make our observations, say, from a rocket ship travelling at a speed very close to the speed of light relative to earth, then it would appear like a (almost) flat disc (See Length Contraction).